microsoft-cdktfconstructs 0.0.3.dev11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- microsoft_cdktfconstructs/__init__.py +217 -0
- microsoft_cdktfconstructs/_jsii/__init__.py +31 -0
- microsoft_cdktfconstructs/_jsii/terraform-cdk-constructs@0.0.3-pre.11.jsii.tgz +0 -0
- microsoft_cdktfconstructs/azure_applicationgateway/__init__.py +823 -0
- microsoft_cdktfconstructs/azure_applicationinsights/__init__.py +397 -0
- microsoft_cdktfconstructs/azure_containerregistry/__init__.py +320 -0
- microsoft_cdktfconstructs/azure_eventhub/__init__.py +2213 -0
- microsoft_cdktfconstructs/azure_functionapp/__init__.py +908 -0
- microsoft_cdktfconstructs/azure_keyvault/__init__.py +1982 -0
- microsoft_cdktfconstructs/azure_kubernetes/__init__.py +400 -0
- microsoft_cdktfconstructs/azure_kusto/__init__.py +2485 -0
- microsoft_cdktfconstructs/azure_loganalytics/__init__.py +652 -0
- microsoft_cdktfconstructs/azure_metricalert/__init__.py +1260 -0
- microsoft_cdktfconstructs/azure_networksecuritygroup/__init__.py +1742 -0
- microsoft_cdktfconstructs/azure_queryrulealert/__init__.py +1189 -0
- microsoft_cdktfconstructs/azure_resourcegroup/__init__.py +320 -0
- microsoft_cdktfconstructs/azure_storageaccount/__init__.py +1910 -0
- microsoft_cdktfconstructs/azure_virtualmachine/__init__.py +1460 -0
- microsoft_cdktfconstructs/azure_virtualmachinescaleset/__init__.py +1185 -0
- microsoft_cdktfconstructs/azure_virtualnetwork/__init__.py +707 -0
- microsoft_cdktfconstructs/core_azure/__init__.py +931 -0
- microsoft_cdktfconstructs/py.typed +1 -0
- microsoft_cdktfconstructs-0.0.3.dev11.dist-info/LICENSE +19 -0
- microsoft_cdktfconstructs-0.0.3.dev11.dist-info/METADATA +188 -0
- microsoft_cdktfconstructs-0.0.3.dev11.dist-info/RECORD +27 -0
- microsoft_cdktfconstructs-0.0.3.dev11.dist-info/WHEEL +5 -0
- microsoft_cdktfconstructs-0.0.3.dev11.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1260 @@
|
|
|
1
|
+
'''
|
|
2
|
+
# Azure Metric Alert Construct
|
|
3
|
+
|
|
4
|
+
This class represents a Metric Alert resource in Azure.
|
|
5
|
+
|
|
6
|
+
## What is Azure Metric Alert?
|
|
7
|
+
|
|
8
|
+
An Azure Metric Alert monitors a pre-computed and pre-aggregated metric over a period of time. We can use Azure provided metrics (see official doc for [dimensions supported](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-metric-near-real-time#metrics-and-dimensions-supported) ) or custom metrics. There are two types of Metric Alerts: `Static alert` and `Dynamic alert`. `Static Metric Alert` is given a static threshold to monitor, whereas `Dynamic Metric Alert` is leverage Azure Machine Learning to learn the normal pattern of metric and alert when the metric is outside of the normal pattern. The alert can also be configured to auto-mitigate when the metric returns to a healthy state.
|
|
9
|
+
|
|
10
|
+
## Azure Metric Alert Class Properties
|
|
11
|
+
|
|
12
|
+
This class has several properties that control the Alert Rules:
|
|
13
|
+
|
|
14
|
+
* `name` - The name of the Metric Alert.
|
|
15
|
+
* `resourceGroupName` - The name of the resource group in which the Metric Alert is created.
|
|
16
|
+
* `scopes` - A set of strings of resource IDs at which the metric criteria should be applied.
|
|
17
|
+
* `criteria` - (Optional) One ore more criteria. Either Criteria or dynamicCriteria is required.
|
|
18
|
+
* `dynamicCriteria` - (Optional) One ore more dynamic criteria. Either Criteria or dynamicCriteria is required.
|
|
19
|
+
* `enabled` - (Optional) Should this Metric Alert be enabled? Defaults to `true`.
|
|
20
|
+
* `automitigate` - (Optional) Should the alerts in this Metric Alert be auto resolved? Defaults to `true`.
|
|
21
|
+
* `frequency` - (Optional) The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to `PT5M`.
|
|
22
|
+
* `windowSize` - (Optional) The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to `PT5M`.
|
|
23
|
+
* `severity` - (Optional) The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to `3`.
|
|
24
|
+
* `description` - (Optional) The description of this Metric Alert.
|
|
25
|
+
* `action` - (Optional) The action block of this Metric Alert.
|
|
26
|
+
* `targetResourceType` - (Optional) The resource type (e.g. Microsoft.Compute/virtualMachines) of the target resource. This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
|
|
27
|
+
* `targetResourceLocation` - (Optional) The location of the target resource. This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
|
|
28
|
+
* `tags` - (Optional) A mapping of tags to assign to the resource.
|
|
29
|
+
|
|
30
|
+
## Deploying a Metric Alert
|
|
31
|
+
|
|
32
|
+
You can deploy a Metric Alert using this class like so:
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
// Create a Resource Group first
|
|
36
|
+
import * as rg from "../azure-resourcegroup";
|
|
37
|
+
const resourceGroup = new rg.Group(this, "myResourceGroup", {
|
|
38
|
+
name: 'myResourceGroup',
|
|
39
|
+
location: 'eastus',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Create a Log Analytics Workspace
|
|
43
|
+
import * as law from "../azure-loganalytics";
|
|
44
|
+
const logAnalyticsWorkspace = new la.Workspace(this, 'myLogAnalytics', {
|
|
45
|
+
name: 'myLogAnalytics',
|
|
46
|
+
location: 'eastus',
|
|
47
|
+
resource_group_name: resourceGroup.name,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Create a Metric Alert with defult settings in Log Analytics Workspace
|
|
51
|
+
import * as ma from "./lib/azure-metricalert";
|
|
52
|
+
new ma.MetricAlert(this, 'metricAlert', {
|
|
53
|
+
name: `myMetricalert`,
|
|
54
|
+
resourceGroupName: resourceGroup.name,
|
|
55
|
+
scopes: [logAnalyticsWorkspace.id],
|
|
56
|
+
criteria: [
|
|
57
|
+
{
|
|
58
|
+
metricName: "Heartbeat",
|
|
59
|
+
metricNamespace: "Microsoft.operationalinsights/workspaces",
|
|
60
|
+
aggregation: "Average",
|
|
61
|
+
operator: "LessThan",
|
|
62
|
+
threshold: 100,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Full example can be found [here](test/ExampleMetricAlert.ts).
|
|
69
|
+
'''
|
|
70
|
+
from pkgutil import extend_path
|
|
71
|
+
__path__ = extend_path(__path__, __name__)
|
|
72
|
+
|
|
73
|
+
import abc
|
|
74
|
+
import builtins
|
|
75
|
+
import datetime
|
|
76
|
+
import enum
|
|
77
|
+
import typing
|
|
78
|
+
|
|
79
|
+
import jsii
|
|
80
|
+
import publication
|
|
81
|
+
import typing_extensions
|
|
82
|
+
|
|
83
|
+
from typeguard import check_type
|
|
84
|
+
|
|
85
|
+
from .._jsii import *
|
|
86
|
+
|
|
87
|
+
import cdktf_cdktf_provider_azurerm.resource_group as _cdktf_cdktf_provider_azurerm_resource_group_92bbcedf
|
|
88
|
+
import constructs as _constructs_77d1e7e8
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@jsii.interface(
|
|
92
|
+
jsii_type="@microsoft/terraform-cdk-constructs.azure_metricalert.IBaseMetricAlertProps"
|
|
93
|
+
)
|
|
94
|
+
class IBaseMetricAlertProps(typing_extensions.Protocol):
|
|
95
|
+
@builtins.property
|
|
96
|
+
@jsii.member(jsii_name="name")
|
|
97
|
+
def name(self) -> builtins.str:
|
|
98
|
+
'''The name of the Metric Alert.
|
|
99
|
+
|
|
100
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#name}
|
|
101
|
+
'''
|
|
102
|
+
...
|
|
103
|
+
|
|
104
|
+
@builtins.property
|
|
105
|
+
@jsii.member(jsii_name="action")
|
|
106
|
+
def action(self) -> typing.Optional[typing.List["MetricAlertActionProp"]]:
|
|
107
|
+
...
|
|
108
|
+
|
|
109
|
+
@builtins.property
|
|
110
|
+
@jsii.member(jsii_name="criteria")
|
|
111
|
+
def criteria(self) -> typing.Optional[typing.List["MetricAlertCriteriaProp"]]:
|
|
112
|
+
'''One ore more criteria.
|
|
113
|
+
|
|
114
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#criteria}
|
|
115
|
+
'''
|
|
116
|
+
...
|
|
117
|
+
|
|
118
|
+
@builtins.property
|
|
119
|
+
@jsii.member(jsii_name="description")
|
|
120
|
+
def description(self) -> typing.Optional[builtins.str]:
|
|
121
|
+
'''The description of this Metric Alert.
|
|
122
|
+
|
|
123
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#description}
|
|
124
|
+
'''
|
|
125
|
+
...
|
|
126
|
+
|
|
127
|
+
@builtins.property
|
|
128
|
+
@jsii.member(jsii_name="dynamicCriteria")
|
|
129
|
+
def dynamic_criteria(
|
|
130
|
+
self,
|
|
131
|
+
) -> typing.Optional[typing.List["MetricAlertDynamicCritiriaProps"]]:
|
|
132
|
+
'''One ore more dynamic criteria.
|
|
133
|
+
|
|
134
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#dynamic_criteria}
|
|
135
|
+
'''
|
|
136
|
+
...
|
|
137
|
+
|
|
138
|
+
@builtins.property
|
|
139
|
+
@jsii.member(jsii_name="tags")
|
|
140
|
+
def tags(self) -> typing.Optional[typing.Mapping[builtins.str, builtins.str]]:
|
|
141
|
+
'''A mapping of tags to assign to the resource.
|
|
142
|
+
|
|
143
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#tags}
|
|
144
|
+
'''
|
|
145
|
+
...
|
|
146
|
+
|
|
147
|
+
@builtins.property
|
|
148
|
+
@jsii.member(jsii_name="targetResourceLocation")
|
|
149
|
+
def target_resource_location(self) -> typing.Optional[builtins.str]:
|
|
150
|
+
'''The location of the target resource.
|
|
151
|
+
|
|
152
|
+
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
|
|
153
|
+
|
|
154
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#target_resource_location}
|
|
155
|
+
'''
|
|
156
|
+
...
|
|
157
|
+
|
|
158
|
+
@builtins.property
|
|
159
|
+
@jsii.member(jsii_name="targetResourceType")
|
|
160
|
+
def target_resource_type(self) -> typing.Optional[builtins.str]:
|
|
161
|
+
'''The resource type (e.g. Microsoft.Compute/virtualMachines) of the target resource. This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
|
|
162
|
+
|
|
163
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#target_resource_type}
|
|
164
|
+
'''
|
|
165
|
+
...
|
|
166
|
+
|
|
167
|
+
@builtins.property
|
|
168
|
+
@jsii.member(jsii_name="automitigate")
|
|
169
|
+
def automitigate(self) -> typing.Optional[builtins.bool]:
|
|
170
|
+
'''Should the alerts in this Metric Alert be auto resolved?
|
|
171
|
+
|
|
172
|
+
:default: true
|
|
173
|
+
|
|
174
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#auto_mitigate}
|
|
175
|
+
'''
|
|
176
|
+
...
|
|
177
|
+
|
|
178
|
+
@automitigate.setter
|
|
179
|
+
def automitigate(self, value: typing.Optional[builtins.bool]) -> None:
|
|
180
|
+
...
|
|
181
|
+
|
|
182
|
+
@builtins.property
|
|
183
|
+
@jsii.member(jsii_name="enabled")
|
|
184
|
+
def enabled(self) -> typing.Optional[builtins.bool]:
|
|
185
|
+
'''Should this Metric Alert be enabled?
|
|
186
|
+
|
|
187
|
+
:default: true
|
|
188
|
+
|
|
189
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#enabled}
|
|
190
|
+
'''
|
|
191
|
+
...
|
|
192
|
+
|
|
193
|
+
@enabled.setter
|
|
194
|
+
def enabled(self, value: typing.Optional[builtins.bool]) -> None:
|
|
195
|
+
...
|
|
196
|
+
|
|
197
|
+
@builtins.property
|
|
198
|
+
@jsii.member(jsii_name="frequency")
|
|
199
|
+
def frequency(self) -> typing.Optional[builtins.str]:
|
|
200
|
+
'''The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format.
|
|
201
|
+
|
|
202
|
+
Possible values are PT1M, PT5M, PT15M, PT30M and PT1H.
|
|
203
|
+
|
|
204
|
+
:default: PT5M
|
|
205
|
+
|
|
206
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#frequency}
|
|
207
|
+
'''
|
|
208
|
+
...
|
|
209
|
+
|
|
210
|
+
@frequency.setter
|
|
211
|
+
def frequency(self, value: typing.Optional[builtins.str]) -> None:
|
|
212
|
+
...
|
|
213
|
+
|
|
214
|
+
@builtins.property
|
|
215
|
+
@jsii.member(jsii_name="severity")
|
|
216
|
+
def severity(self) -> typing.Optional[jsii.Number]:
|
|
217
|
+
'''The severity of this Metric Alert.
|
|
218
|
+
|
|
219
|
+
Possible values are 0, 1, 2, 3 and 4.
|
|
220
|
+
|
|
221
|
+
:default: 3
|
|
222
|
+
|
|
223
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#severity}
|
|
224
|
+
'''
|
|
225
|
+
...
|
|
226
|
+
|
|
227
|
+
@severity.setter
|
|
228
|
+
def severity(self, value: typing.Optional[jsii.Number]) -> None:
|
|
229
|
+
...
|
|
230
|
+
|
|
231
|
+
@builtins.property
|
|
232
|
+
@jsii.member(jsii_name="windowSize")
|
|
233
|
+
def window_size(self) -> typing.Optional[builtins.str]:
|
|
234
|
+
'''The period of time that is used to monitor alert activity, represented in ISO 8601 duration format.
|
|
235
|
+
|
|
236
|
+
This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D.
|
|
237
|
+
|
|
238
|
+
:default: PT5M
|
|
239
|
+
|
|
240
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#window_size}
|
|
241
|
+
'''
|
|
242
|
+
...
|
|
243
|
+
|
|
244
|
+
@window_size.setter
|
|
245
|
+
def window_size(self, value: typing.Optional[builtins.str]) -> None:
|
|
246
|
+
...
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class _IBaseMetricAlertPropsProxy:
|
|
250
|
+
__jsii_type__: typing.ClassVar[str] = "@microsoft/terraform-cdk-constructs.azure_metricalert.IBaseMetricAlertProps"
|
|
251
|
+
|
|
252
|
+
@builtins.property
|
|
253
|
+
@jsii.member(jsii_name="name")
|
|
254
|
+
def name(self) -> builtins.str:
|
|
255
|
+
'''The name of the Metric Alert.
|
|
256
|
+
|
|
257
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#name}
|
|
258
|
+
'''
|
|
259
|
+
return typing.cast(builtins.str, jsii.get(self, "name"))
|
|
260
|
+
|
|
261
|
+
@builtins.property
|
|
262
|
+
@jsii.member(jsii_name="action")
|
|
263
|
+
def action(self) -> typing.Optional[typing.List["MetricAlertActionProp"]]:
|
|
264
|
+
return typing.cast(typing.Optional[typing.List["MetricAlertActionProp"]], jsii.get(self, "action"))
|
|
265
|
+
|
|
266
|
+
@builtins.property
|
|
267
|
+
@jsii.member(jsii_name="criteria")
|
|
268
|
+
def criteria(self) -> typing.Optional[typing.List["MetricAlertCriteriaProp"]]:
|
|
269
|
+
'''One ore more criteria.
|
|
270
|
+
|
|
271
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#criteria}
|
|
272
|
+
'''
|
|
273
|
+
return typing.cast(typing.Optional[typing.List["MetricAlertCriteriaProp"]], jsii.get(self, "criteria"))
|
|
274
|
+
|
|
275
|
+
@builtins.property
|
|
276
|
+
@jsii.member(jsii_name="description")
|
|
277
|
+
def description(self) -> typing.Optional[builtins.str]:
|
|
278
|
+
'''The description of this Metric Alert.
|
|
279
|
+
|
|
280
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#description}
|
|
281
|
+
'''
|
|
282
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "description"))
|
|
283
|
+
|
|
284
|
+
@builtins.property
|
|
285
|
+
@jsii.member(jsii_name="dynamicCriteria")
|
|
286
|
+
def dynamic_criteria(
|
|
287
|
+
self,
|
|
288
|
+
) -> typing.Optional[typing.List["MetricAlertDynamicCritiriaProps"]]:
|
|
289
|
+
'''One ore more dynamic criteria.
|
|
290
|
+
|
|
291
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#dynamic_criteria}
|
|
292
|
+
'''
|
|
293
|
+
return typing.cast(typing.Optional[typing.List["MetricAlertDynamicCritiriaProps"]], jsii.get(self, "dynamicCriteria"))
|
|
294
|
+
|
|
295
|
+
@builtins.property
|
|
296
|
+
@jsii.member(jsii_name="tags")
|
|
297
|
+
def tags(self) -> typing.Optional[typing.Mapping[builtins.str, builtins.str]]:
|
|
298
|
+
'''A mapping of tags to assign to the resource.
|
|
299
|
+
|
|
300
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#tags}
|
|
301
|
+
'''
|
|
302
|
+
return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], jsii.get(self, "tags"))
|
|
303
|
+
|
|
304
|
+
@builtins.property
|
|
305
|
+
@jsii.member(jsii_name="targetResourceLocation")
|
|
306
|
+
def target_resource_location(self) -> typing.Optional[builtins.str]:
|
|
307
|
+
'''The location of the target resource.
|
|
308
|
+
|
|
309
|
+
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
|
|
310
|
+
|
|
311
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#target_resource_location}
|
|
312
|
+
'''
|
|
313
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "targetResourceLocation"))
|
|
314
|
+
|
|
315
|
+
@builtins.property
|
|
316
|
+
@jsii.member(jsii_name="targetResourceType")
|
|
317
|
+
def target_resource_type(self) -> typing.Optional[builtins.str]:
|
|
318
|
+
'''The resource type (e.g. Microsoft.Compute/virtualMachines) of the target resource. This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
|
|
319
|
+
|
|
320
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#target_resource_type}
|
|
321
|
+
'''
|
|
322
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "targetResourceType"))
|
|
323
|
+
|
|
324
|
+
@builtins.property
|
|
325
|
+
@jsii.member(jsii_name="automitigate")
|
|
326
|
+
def automitigate(self) -> typing.Optional[builtins.bool]:
|
|
327
|
+
'''Should the alerts in this Metric Alert be auto resolved?
|
|
328
|
+
|
|
329
|
+
:default: true
|
|
330
|
+
|
|
331
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#auto_mitigate}
|
|
332
|
+
'''
|
|
333
|
+
return typing.cast(typing.Optional[builtins.bool], jsii.get(self, "automitigate"))
|
|
334
|
+
|
|
335
|
+
@automitigate.setter
|
|
336
|
+
def automitigate(self, value: typing.Optional[builtins.bool]) -> None:
|
|
337
|
+
if __debug__:
|
|
338
|
+
type_hints = typing.get_type_hints(_typecheckingstub__d9b6d2f05b6ed0d46af4ec9192122ef44c3980479c396d43304bb0b9b694e113)
|
|
339
|
+
check_type(argname="argument value", value=value, expected_type=type_hints["value"])
|
|
340
|
+
jsii.set(self, "automitigate", value)
|
|
341
|
+
|
|
342
|
+
@builtins.property
|
|
343
|
+
@jsii.member(jsii_name="enabled")
|
|
344
|
+
def enabled(self) -> typing.Optional[builtins.bool]:
|
|
345
|
+
'''Should this Metric Alert be enabled?
|
|
346
|
+
|
|
347
|
+
:default: true
|
|
348
|
+
|
|
349
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#enabled}
|
|
350
|
+
'''
|
|
351
|
+
return typing.cast(typing.Optional[builtins.bool], jsii.get(self, "enabled"))
|
|
352
|
+
|
|
353
|
+
@enabled.setter
|
|
354
|
+
def enabled(self, value: typing.Optional[builtins.bool]) -> None:
|
|
355
|
+
if __debug__:
|
|
356
|
+
type_hints = typing.get_type_hints(_typecheckingstub__a71a6bc41cbe01c48e85fc89a6e119390fa9f8a525e7cf56ded112c85d2ce1b4)
|
|
357
|
+
check_type(argname="argument value", value=value, expected_type=type_hints["value"])
|
|
358
|
+
jsii.set(self, "enabled", value)
|
|
359
|
+
|
|
360
|
+
@builtins.property
|
|
361
|
+
@jsii.member(jsii_name="frequency")
|
|
362
|
+
def frequency(self) -> typing.Optional[builtins.str]:
|
|
363
|
+
'''The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format.
|
|
364
|
+
|
|
365
|
+
Possible values are PT1M, PT5M, PT15M, PT30M and PT1H.
|
|
366
|
+
|
|
367
|
+
:default: PT5M
|
|
368
|
+
|
|
369
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#frequency}
|
|
370
|
+
'''
|
|
371
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "frequency"))
|
|
372
|
+
|
|
373
|
+
@frequency.setter
|
|
374
|
+
def frequency(self, value: typing.Optional[builtins.str]) -> None:
|
|
375
|
+
if __debug__:
|
|
376
|
+
type_hints = typing.get_type_hints(_typecheckingstub__6121ecbd0831518b2ec58c88fba21c560e324250edb73d3cb548e7b87b63cb7a)
|
|
377
|
+
check_type(argname="argument value", value=value, expected_type=type_hints["value"])
|
|
378
|
+
jsii.set(self, "frequency", value)
|
|
379
|
+
|
|
380
|
+
@builtins.property
|
|
381
|
+
@jsii.member(jsii_name="severity")
|
|
382
|
+
def severity(self) -> typing.Optional[jsii.Number]:
|
|
383
|
+
'''The severity of this Metric Alert.
|
|
384
|
+
|
|
385
|
+
Possible values are 0, 1, 2, 3 and 4.
|
|
386
|
+
|
|
387
|
+
:default: 3
|
|
388
|
+
|
|
389
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#severity}
|
|
390
|
+
'''
|
|
391
|
+
return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "severity"))
|
|
392
|
+
|
|
393
|
+
@severity.setter
|
|
394
|
+
def severity(self, value: typing.Optional[jsii.Number]) -> None:
|
|
395
|
+
if __debug__:
|
|
396
|
+
type_hints = typing.get_type_hints(_typecheckingstub__4208080d1e6a948e5cd36c58ec3192a87a4670c52f57c2611997528c85acd7f0)
|
|
397
|
+
check_type(argname="argument value", value=value, expected_type=type_hints["value"])
|
|
398
|
+
jsii.set(self, "severity", value)
|
|
399
|
+
|
|
400
|
+
@builtins.property
|
|
401
|
+
@jsii.member(jsii_name="windowSize")
|
|
402
|
+
def window_size(self) -> typing.Optional[builtins.str]:
|
|
403
|
+
'''The period of time that is used to monitor alert activity, represented in ISO 8601 duration format.
|
|
404
|
+
|
|
405
|
+
This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D.
|
|
406
|
+
|
|
407
|
+
:default: PT5M
|
|
408
|
+
|
|
409
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#window_size}
|
|
410
|
+
'''
|
|
411
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "windowSize"))
|
|
412
|
+
|
|
413
|
+
@window_size.setter
|
|
414
|
+
def window_size(self, value: typing.Optional[builtins.str]) -> None:
|
|
415
|
+
if __debug__:
|
|
416
|
+
type_hints = typing.get_type_hints(_typecheckingstub__32d092155070280bb1f6c612ff5cfd8100865141ec1f19899057122299f11708)
|
|
417
|
+
check_type(argname="argument value", value=value, expected_type=type_hints["value"])
|
|
418
|
+
jsii.set(self, "windowSize", value)
|
|
419
|
+
|
|
420
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
|
|
421
|
+
typing.cast(typing.Any, IBaseMetricAlertProps).__jsii_proxy_class__ = lambda : _IBaseMetricAlertPropsProxy
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
@jsii.interface(
|
|
425
|
+
jsii_type="@microsoft/terraform-cdk-constructs.azure_metricalert.IMetricAlertProps"
|
|
426
|
+
)
|
|
427
|
+
class IMetricAlertProps(IBaseMetricAlertProps, typing_extensions.Protocol):
|
|
428
|
+
@builtins.property
|
|
429
|
+
@jsii.member(jsii_name="resourceGroup")
|
|
430
|
+
def resource_group(
|
|
431
|
+
self,
|
|
432
|
+
) -> _cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup:
|
|
433
|
+
'''The name of the resource group in which the Metric Alert is created.
|
|
434
|
+
|
|
435
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#resource_group_name}
|
|
436
|
+
'''
|
|
437
|
+
...
|
|
438
|
+
|
|
439
|
+
@builtins.property
|
|
440
|
+
@jsii.member(jsii_name="scopes")
|
|
441
|
+
def scopes(self) -> typing.List[builtins.str]:
|
|
442
|
+
'''A set of strings of resource IDs at which the metric criteria should be applied.
|
|
443
|
+
|
|
444
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#scopes}
|
|
445
|
+
'''
|
|
446
|
+
...
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
class _IMetricAlertPropsProxy(
|
|
450
|
+
jsii.proxy_for(IBaseMetricAlertProps), # type: ignore[misc]
|
|
451
|
+
):
|
|
452
|
+
__jsii_type__: typing.ClassVar[str] = "@microsoft/terraform-cdk-constructs.azure_metricalert.IMetricAlertProps"
|
|
453
|
+
|
|
454
|
+
@builtins.property
|
|
455
|
+
@jsii.member(jsii_name="resourceGroup")
|
|
456
|
+
def resource_group(
|
|
457
|
+
self,
|
|
458
|
+
) -> _cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup:
|
|
459
|
+
'''The name of the resource group in which the Metric Alert is created.
|
|
460
|
+
|
|
461
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#resource_group_name}
|
|
462
|
+
'''
|
|
463
|
+
return typing.cast(_cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup, jsii.get(self, "resourceGroup"))
|
|
464
|
+
|
|
465
|
+
@builtins.property
|
|
466
|
+
@jsii.member(jsii_name="scopes")
|
|
467
|
+
def scopes(self) -> typing.List[builtins.str]:
|
|
468
|
+
'''A set of strings of resource IDs at which the metric criteria should be applied.
|
|
469
|
+
|
|
470
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#scopes}
|
|
471
|
+
'''
|
|
472
|
+
return typing.cast(typing.List[builtins.str], jsii.get(self, "scopes"))
|
|
473
|
+
|
|
474
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
|
|
475
|
+
typing.cast(typing.Any, IMetricAlertProps).__jsii_proxy_class__ = lambda : _IMetricAlertPropsProxy
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
class MetricAlert(
|
|
479
|
+
_constructs_77d1e7e8.Construct,
|
|
480
|
+
metaclass=jsii.JSIIMeta,
|
|
481
|
+
jsii_type="@microsoft/terraform-cdk-constructs.azure_metricalert.MetricAlert",
|
|
482
|
+
):
|
|
483
|
+
def __init__(
|
|
484
|
+
self,
|
|
485
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
486
|
+
id: builtins.str,
|
|
487
|
+
props: IMetricAlertProps,
|
|
488
|
+
) -> None:
|
|
489
|
+
'''Represents a Metric Alert in Azure Monitor, which is used to automatically monitor metrics across Azure services and trigger actions when certain conditions are met.
|
|
490
|
+
|
|
491
|
+
This class encapsulates the configuration and management of a Metric Alert, allowing users to define alert rules based on the metrics from their Azure resources. Metric Alerts can help in proactively managing the health, performance, and availability of Azure services.
|
|
492
|
+
|
|
493
|
+
Properties:
|
|
494
|
+
|
|
495
|
+
- ``name``: The name of the Metric Alert, which must be unique within the resource group.
|
|
496
|
+
- ``description``: Optional. A description of what the Metric Alert monitors and potential impact or remediation.
|
|
497
|
+
- ``enabled``: Indicates whether the alert rule is enabled. Disabled rules will not fire.
|
|
498
|
+
- ``autoMitigate``: Specifies whether the alert should attempt auto-mitigation actions when triggered.
|
|
499
|
+
- ``frequency``: The frequency of evaluation for the alert rule, determining how often the rule is checked.
|
|
500
|
+
- ``severity``: The severity level assigned to the alert. This helps in categorizing the urgency of the alert.
|
|
501
|
+
- ``targetResourceType``: Specifies the type of Azure resource the alert rule applies to, necessary for scoping the alert.
|
|
502
|
+
- ``targetResourceLocation``: Specifies the location of the target resource, required when the alert rule covers resources in multiple locations.
|
|
503
|
+
- ``windowSize``: The period over which data is collected for analysis, which must be greater than the frequency of evaluation.
|
|
504
|
+
- ``tags``: User-defined tags to help organize and identify resources within Azure.
|
|
505
|
+
- ``criteria``: The conditions that trigger the alert. This can be static or dynamic, based on the behavior of the monitored metric over time.
|
|
506
|
+
- ``dynamicCriteria``: Advanced configurations for criteria that dynamically adjust thresholds based on historical data.
|
|
507
|
+
- ``scopes``: The specific resources that the Metric Alert is scoped to monitor.
|
|
508
|
+
- ``resourceGroup``: The Azure Resource Group in which this Metric Alert is defined.
|
|
509
|
+
|
|
510
|
+
Example usage::
|
|
511
|
+
|
|
512
|
+
const cpuAlertProps: IMetricAlertProps = {
|
|
513
|
+
name: 'High CPU Usage Alert',
|
|
514
|
+
resourceGroup: resourceGroupInstance,
|
|
515
|
+
scopes: [vm.id],
|
|
516
|
+
criteria: [
|
|
517
|
+
{
|
|
518
|
+
metricName: 'Percentage CPU',
|
|
519
|
+
operator: 'GreaterThan',
|
|
520
|
+
threshold: 80,
|
|
521
|
+
aggregation: 'Average'
|
|
522
|
+
}
|
|
523
|
+
],
|
|
524
|
+
frequency: 'PT1M',
|
|
525
|
+
windowSize: 'PT5M',
|
|
526
|
+
severity: 3,
|
|
527
|
+
enabled: true
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
const cpuAlert = new MetricAlert(this, 'cpuUsageAlert', cpuAlertProps);
|
|
531
|
+
|
|
532
|
+
This configuration defines a Metric Alert that monitors CPU usage across specified virtual machines, triggering an alert if the CPU usage exceeds 80% over a 5-minute window, evaluated every minute.
|
|
533
|
+
|
|
534
|
+
:param scope: -
|
|
535
|
+
:param id: -
|
|
536
|
+
:param props: -
|
|
537
|
+
'''
|
|
538
|
+
if __debug__:
|
|
539
|
+
type_hints = typing.get_type_hints(_typecheckingstub__89a31dd72d07a3fb3ea9f11c966fd677dff2f202fa495d954aa9d15a60a7539b)
|
|
540
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
541
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
542
|
+
check_type(argname="argument props", value=props, expected_type=type_hints["props"])
|
|
543
|
+
jsii.create(self.__class__, self, [scope, id, props])
|
|
544
|
+
|
|
545
|
+
@builtins.property
|
|
546
|
+
@jsii.member(jsii_name="id")
|
|
547
|
+
def id(self) -> builtins.str:
|
|
548
|
+
return typing.cast(builtins.str, jsii.get(self, "id"))
|
|
549
|
+
|
|
550
|
+
@builtins.property
|
|
551
|
+
@jsii.member(jsii_name="props")
|
|
552
|
+
def props(self) -> IMetricAlertProps:
|
|
553
|
+
return typing.cast(IMetricAlertProps, jsii.get(self, "props"))
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
@jsii.data_type(
|
|
557
|
+
jsii_type="@microsoft/terraform-cdk-constructs.azure_metricalert.MetricAlertActionProp",
|
|
558
|
+
jsii_struct_bases=[],
|
|
559
|
+
name_mapping={"action_group_id": "actionGroupId"},
|
|
560
|
+
)
|
|
561
|
+
class MetricAlertActionProp:
|
|
562
|
+
def __init__(self, *, action_group_id: typing.Sequence[builtins.str]) -> None:
|
|
563
|
+
'''
|
|
564
|
+
:param action_group_id: The ID of the Action Group.
|
|
565
|
+
|
|
566
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#action}
|
|
567
|
+
:description: The Action to trigger when the Metric Alert fires.
|
|
568
|
+
'''
|
|
569
|
+
if __debug__:
|
|
570
|
+
type_hints = typing.get_type_hints(_typecheckingstub__c10e6a840860f6b4069b766a02a280d1a0fbeb3f59e8d4149c18a3a463743083)
|
|
571
|
+
check_type(argname="argument action_group_id", value=action_group_id, expected_type=type_hints["action_group_id"])
|
|
572
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
573
|
+
"action_group_id": action_group_id,
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
@builtins.property
|
|
577
|
+
def action_group_id(self) -> typing.List[builtins.str]:
|
|
578
|
+
'''The ID of the Action Group.
|
|
579
|
+
|
|
580
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#action_group_id}
|
|
581
|
+
'''
|
|
582
|
+
result = self._values.get("action_group_id")
|
|
583
|
+
assert result is not None, "Required property 'action_group_id' is missing"
|
|
584
|
+
return typing.cast(typing.List[builtins.str], result)
|
|
585
|
+
|
|
586
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
587
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
588
|
+
|
|
589
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
590
|
+
return not (rhs == self)
|
|
591
|
+
|
|
592
|
+
def __repr__(self) -> str:
|
|
593
|
+
return "MetricAlertActionProp(%s)" % ", ".join(
|
|
594
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
595
|
+
)
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
@jsii.data_type(
|
|
599
|
+
jsii_type="@microsoft/terraform-cdk-constructs.azure_metricalert.MetricAlertCriteriaBaseProps",
|
|
600
|
+
jsii_struct_bases=[],
|
|
601
|
+
name_mapping={
|
|
602
|
+
"aggregation": "aggregation",
|
|
603
|
+
"metric_name": "metricName",
|
|
604
|
+
"metric_namespace": "metricNamespace",
|
|
605
|
+
"operator": "operator",
|
|
606
|
+
"dimension": "dimension",
|
|
607
|
+
"skip_metric_validation": "skipMetricValidation",
|
|
608
|
+
},
|
|
609
|
+
)
|
|
610
|
+
class MetricAlertCriteriaBaseProps:
|
|
611
|
+
def __init__(
|
|
612
|
+
self,
|
|
613
|
+
*,
|
|
614
|
+
aggregation: builtins.str,
|
|
615
|
+
metric_name: builtins.str,
|
|
616
|
+
metric_namespace: builtins.str,
|
|
617
|
+
operator: builtins.str,
|
|
618
|
+
dimension: typing.Optional[typing.Sequence[typing.Union["MetricAlertCriteriaDimensionProp", typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
619
|
+
skip_metric_validation: typing.Optional[builtins.bool] = None,
|
|
620
|
+
) -> None:
|
|
621
|
+
'''
|
|
622
|
+
:param aggregation: The aggregation type to apply to the metric. Possible values are Average, Count, Minimum, Maximum and Total.
|
|
623
|
+
:param metric_name: The name of the metric to monitor.
|
|
624
|
+
:param metric_namespace: The namespace of the metric.
|
|
625
|
+
:param operator: The operator to apply to the metric. Possible values are Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan and LessThanOrEqual.
|
|
626
|
+
:param dimension: One or more dimensions.
|
|
627
|
+
:param skip_metric_validation: Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Default: false.
|
|
628
|
+
|
|
629
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#criteria}
|
|
630
|
+
:description: The base criteria properties for a Metric Alert.
|
|
631
|
+
'''
|
|
632
|
+
if __debug__:
|
|
633
|
+
type_hints = typing.get_type_hints(_typecheckingstub__6d07a7654959ce4d1f3e2cfa72b5acc5537f57d967a4d561b13ea4c9114815c6)
|
|
634
|
+
check_type(argname="argument aggregation", value=aggregation, expected_type=type_hints["aggregation"])
|
|
635
|
+
check_type(argname="argument metric_name", value=metric_name, expected_type=type_hints["metric_name"])
|
|
636
|
+
check_type(argname="argument metric_namespace", value=metric_namespace, expected_type=type_hints["metric_namespace"])
|
|
637
|
+
check_type(argname="argument operator", value=operator, expected_type=type_hints["operator"])
|
|
638
|
+
check_type(argname="argument dimension", value=dimension, expected_type=type_hints["dimension"])
|
|
639
|
+
check_type(argname="argument skip_metric_validation", value=skip_metric_validation, expected_type=type_hints["skip_metric_validation"])
|
|
640
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
641
|
+
"aggregation": aggregation,
|
|
642
|
+
"metric_name": metric_name,
|
|
643
|
+
"metric_namespace": metric_namespace,
|
|
644
|
+
"operator": operator,
|
|
645
|
+
}
|
|
646
|
+
if dimension is not None:
|
|
647
|
+
self._values["dimension"] = dimension
|
|
648
|
+
if skip_metric_validation is not None:
|
|
649
|
+
self._values["skip_metric_validation"] = skip_metric_validation
|
|
650
|
+
|
|
651
|
+
@builtins.property
|
|
652
|
+
def aggregation(self) -> builtins.str:
|
|
653
|
+
'''The aggregation type to apply to the metric.
|
|
654
|
+
|
|
655
|
+
Possible values are Average, Count, Minimum, Maximum and Total.
|
|
656
|
+
|
|
657
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#aggregation}
|
|
658
|
+
'''
|
|
659
|
+
result = self._values.get("aggregation")
|
|
660
|
+
assert result is not None, "Required property 'aggregation' is missing"
|
|
661
|
+
return typing.cast(builtins.str, result)
|
|
662
|
+
|
|
663
|
+
@builtins.property
|
|
664
|
+
def metric_name(self) -> builtins.str:
|
|
665
|
+
'''The name of the metric to monitor.
|
|
666
|
+
|
|
667
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#metric_name}
|
|
668
|
+
'''
|
|
669
|
+
result = self._values.get("metric_name")
|
|
670
|
+
assert result is not None, "Required property 'metric_name' is missing"
|
|
671
|
+
return typing.cast(builtins.str, result)
|
|
672
|
+
|
|
673
|
+
@builtins.property
|
|
674
|
+
def metric_namespace(self) -> builtins.str:
|
|
675
|
+
'''The namespace of the metric.
|
|
676
|
+
|
|
677
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#metric_namespace}
|
|
678
|
+
'''
|
|
679
|
+
result = self._values.get("metric_namespace")
|
|
680
|
+
assert result is not None, "Required property 'metric_namespace' is missing"
|
|
681
|
+
return typing.cast(builtins.str, result)
|
|
682
|
+
|
|
683
|
+
@builtins.property
|
|
684
|
+
def operator(self) -> builtins.str:
|
|
685
|
+
'''The operator to apply to the metric.
|
|
686
|
+
|
|
687
|
+
Possible values are Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan and LessThanOrEqual.
|
|
688
|
+
|
|
689
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#operator}
|
|
690
|
+
'''
|
|
691
|
+
result = self._values.get("operator")
|
|
692
|
+
assert result is not None, "Required property 'operator' is missing"
|
|
693
|
+
return typing.cast(builtins.str, result)
|
|
694
|
+
|
|
695
|
+
@builtins.property
|
|
696
|
+
def dimension(
|
|
697
|
+
self,
|
|
698
|
+
) -> typing.Optional[typing.List["MetricAlertCriteriaDimensionProp"]]:
|
|
699
|
+
'''One or more dimensions.
|
|
700
|
+
|
|
701
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#dimension}
|
|
702
|
+
'''
|
|
703
|
+
result = self._values.get("dimension")
|
|
704
|
+
return typing.cast(typing.Optional[typing.List["MetricAlertCriteriaDimensionProp"]], result)
|
|
705
|
+
|
|
706
|
+
@builtins.property
|
|
707
|
+
def skip_metric_validation(self) -> typing.Optional[builtins.bool]:
|
|
708
|
+
'''Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
|
|
709
|
+
|
|
710
|
+
:default: false.
|
|
711
|
+
|
|
712
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#skip_metric_validation}
|
|
713
|
+
'''
|
|
714
|
+
result = self._values.get("skip_metric_validation")
|
|
715
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
716
|
+
|
|
717
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
718
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
719
|
+
|
|
720
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
721
|
+
return not (rhs == self)
|
|
722
|
+
|
|
723
|
+
def __repr__(self) -> str:
|
|
724
|
+
return "MetricAlertCriteriaBaseProps(%s)" % ", ".join(
|
|
725
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
726
|
+
)
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
@jsii.data_type(
|
|
730
|
+
jsii_type="@microsoft/terraform-cdk-constructs.azure_metricalert.MetricAlertCriteriaDimensionProp",
|
|
731
|
+
jsii_struct_bases=[],
|
|
732
|
+
name_mapping={"name": "name", "operator": "operator", "values": "values"},
|
|
733
|
+
)
|
|
734
|
+
class MetricAlertCriteriaDimensionProp:
|
|
735
|
+
def __init__(
|
|
736
|
+
self,
|
|
737
|
+
*,
|
|
738
|
+
name: builtins.str,
|
|
739
|
+
operator: builtins.str,
|
|
740
|
+
values: typing.Sequence[builtins.str],
|
|
741
|
+
) -> None:
|
|
742
|
+
'''
|
|
743
|
+
:param name: The dimension name.
|
|
744
|
+
:param operator: The dimension operator. Possible values are Include, Exclude and StartsWith.
|
|
745
|
+
:param values: The dimension values. Use a wildcard * to collect all.
|
|
746
|
+
|
|
747
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#dimension}
|
|
748
|
+
:description: The dimension properties for a Metric Alert Criteria.
|
|
749
|
+
'''
|
|
750
|
+
if __debug__:
|
|
751
|
+
type_hints = typing.get_type_hints(_typecheckingstub__fad1a3301130bfb3fc3685343a7ae98a55d316b0f52af7dc52f87c22204f7e84)
|
|
752
|
+
check_type(argname="argument name", value=name, expected_type=type_hints["name"])
|
|
753
|
+
check_type(argname="argument operator", value=operator, expected_type=type_hints["operator"])
|
|
754
|
+
check_type(argname="argument values", value=values, expected_type=type_hints["values"])
|
|
755
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
756
|
+
"name": name,
|
|
757
|
+
"operator": operator,
|
|
758
|
+
"values": values,
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
@builtins.property
|
|
762
|
+
def name(self) -> builtins.str:
|
|
763
|
+
'''The dimension name.
|
|
764
|
+
|
|
765
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#dimension_name}
|
|
766
|
+
'''
|
|
767
|
+
result = self._values.get("name")
|
|
768
|
+
assert result is not None, "Required property 'name' is missing"
|
|
769
|
+
return typing.cast(builtins.str, result)
|
|
770
|
+
|
|
771
|
+
@builtins.property
|
|
772
|
+
def operator(self) -> builtins.str:
|
|
773
|
+
'''The dimension operator.
|
|
774
|
+
|
|
775
|
+
Possible values are Include, Exclude and StartsWith.
|
|
776
|
+
|
|
777
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#dimension_operator}
|
|
778
|
+
'''
|
|
779
|
+
result = self._values.get("operator")
|
|
780
|
+
assert result is not None, "Required property 'operator' is missing"
|
|
781
|
+
return typing.cast(builtins.str, result)
|
|
782
|
+
|
|
783
|
+
@builtins.property
|
|
784
|
+
def values(self) -> typing.List[builtins.str]:
|
|
785
|
+
'''The dimension values.
|
|
786
|
+
|
|
787
|
+
Use a wildcard * to collect all.
|
|
788
|
+
|
|
789
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#dimension_values}
|
|
790
|
+
'''
|
|
791
|
+
result = self._values.get("values")
|
|
792
|
+
assert result is not None, "Required property 'values' is missing"
|
|
793
|
+
return typing.cast(typing.List[builtins.str], result)
|
|
794
|
+
|
|
795
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
796
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
797
|
+
|
|
798
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
799
|
+
return not (rhs == self)
|
|
800
|
+
|
|
801
|
+
def __repr__(self) -> str:
|
|
802
|
+
return "MetricAlertCriteriaDimensionProp(%s)" % ", ".join(
|
|
803
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
804
|
+
)
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
@jsii.data_type(
|
|
808
|
+
jsii_type="@microsoft/terraform-cdk-constructs.azure_metricalert.MetricAlertCriteriaProp",
|
|
809
|
+
jsii_struct_bases=[MetricAlertCriteriaBaseProps],
|
|
810
|
+
name_mapping={
|
|
811
|
+
"aggregation": "aggregation",
|
|
812
|
+
"metric_name": "metricName",
|
|
813
|
+
"metric_namespace": "metricNamespace",
|
|
814
|
+
"operator": "operator",
|
|
815
|
+
"dimension": "dimension",
|
|
816
|
+
"skip_metric_validation": "skipMetricValidation",
|
|
817
|
+
"threshold": "threshold",
|
|
818
|
+
},
|
|
819
|
+
)
|
|
820
|
+
class MetricAlertCriteriaProp(MetricAlertCriteriaBaseProps):
|
|
821
|
+
def __init__(
|
|
822
|
+
self,
|
|
823
|
+
*,
|
|
824
|
+
aggregation: builtins.str,
|
|
825
|
+
metric_name: builtins.str,
|
|
826
|
+
metric_namespace: builtins.str,
|
|
827
|
+
operator: builtins.str,
|
|
828
|
+
dimension: typing.Optional[typing.Sequence[typing.Union[MetricAlertCriteriaDimensionProp, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
829
|
+
skip_metric_validation: typing.Optional[builtins.bool] = None,
|
|
830
|
+
threshold: jsii.Number,
|
|
831
|
+
) -> None:
|
|
832
|
+
'''
|
|
833
|
+
:param aggregation: The aggregation type to apply to the metric. Possible values are Average, Count, Minimum, Maximum and Total.
|
|
834
|
+
:param metric_name: The name of the metric to monitor.
|
|
835
|
+
:param metric_namespace: The namespace of the metric.
|
|
836
|
+
:param operator: The operator to apply to the metric. Possible values are Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan and LessThanOrEqual.
|
|
837
|
+
:param dimension: One or more dimensions.
|
|
838
|
+
:param skip_metric_validation: Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Default: false.
|
|
839
|
+
:param threshold: The threshold value for the metric that triggers the alert.
|
|
840
|
+
|
|
841
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#criteria}
|
|
842
|
+
:description: The criteria properties for a Metric Alert.
|
|
843
|
+
'''
|
|
844
|
+
if __debug__:
|
|
845
|
+
type_hints = typing.get_type_hints(_typecheckingstub__a8510797c51c82823528fa3e989c82b1aa00ee5541f39bca355ff9b7797b0d91)
|
|
846
|
+
check_type(argname="argument aggregation", value=aggregation, expected_type=type_hints["aggregation"])
|
|
847
|
+
check_type(argname="argument metric_name", value=metric_name, expected_type=type_hints["metric_name"])
|
|
848
|
+
check_type(argname="argument metric_namespace", value=metric_namespace, expected_type=type_hints["metric_namespace"])
|
|
849
|
+
check_type(argname="argument operator", value=operator, expected_type=type_hints["operator"])
|
|
850
|
+
check_type(argname="argument dimension", value=dimension, expected_type=type_hints["dimension"])
|
|
851
|
+
check_type(argname="argument skip_metric_validation", value=skip_metric_validation, expected_type=type_hints["skip_metric_validation"])
|
|
852
|
+
check_type(argname="argument threshold", value=threshold, expected_type=type_hints["threshold"])
|
|
853
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
854
|
+
"aggregation": aggregation,
|
|
855
|
+
"metric_name": metric_name,
|
|
856
|
+
"metric_namespace": metric_namespace,
|
|
857
|
+
"operator": operator,
|
|
858
|
+
"threshold": threshold,
|
|
859
|
+
}
|
|
860
|
+
if dimension is not None:
|
|
861
|
+
self._values["dimension"] = dimension
|
|
862
|
+
if skip_metric_validation is not None:
|
|
863
|
+
self._values["skip_metric_validation"] = skip_metric_validation
|
|
864
|
+
|
|
865
|
+
@builtins.property
|
|
866
|
+
def aggregation(self) -> builtins.str:
|
|
867
|
+
'''The aggregation type to apply to the metric.
|
|
868
|
+
|
|
869
|
+
Possible values are Average, Count, Minimum, Maximum and Total.
|
|
870
|
+
|
|
871
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#aggregation}
|
|
872
|
+
'''
|
|
873
|
+
result = self._values.get("aggregation")
|
|
874
|
+
assert result is not None, "Required property 'aggregation' is missing"
|
|
875
|
+
return typing.cast(builtins.str, result)
|
|
876
|
+
|
|
877
|
+
@builtins.property
|
|
878
|
+
def metric_name(self) -> builtins.str:
|
|
879
|
+
'''The name of the metric to monitor.
|
|
880
|
+
|
|
881
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#metric_name}
|
|
882
|
+
'''
|
|
883
|
+
result = self._values.get("metric_name")
|
|
884
|
+
assert result is not None, "Required property 'metric_name' is missing"
|
|
885
|
+
return typing.cast(builtins.str, result)
|
|
886
|
+
|
|
887
|
+
@builtins.property
|
|
888
|
+
def metric_namespace(self) -> builtins.str:
|
|
889
|
+
'''The namespace of the metric.
|
|
890
|
+
|
|
891
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#metric_namespace}
|
|
892
|
+
'''
|
|
893
|
+
result = self._values.get("metric_namespace")
|
|
894
|
+
assert result is not None, "Required property 'metric_namespace' is missing"
|
|
895
|
+
return typing.cast(builtins.str, result)
|
|
896
|
+
|
|
897
|
+
@builtins.property
|
|
898
|
+
def operator(self) -> builtins.str:
|
|
899
|
+
'''The operator to apply to the metric.
|
|
900
|
+
|
|
901
|
+
Possible values are Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan and LessThanOrEqual.
|
|
902
|
+
|
|
903
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#operator}
|
|
904
|
+
'''
|
|
905
|
+
result = self._values.get("operator")
|
|
906
|
+
assert result is not None, "Required property 'operator' is missing"
|
|
907
|
+
return typing.cast(builtins.str, result)
|
|
908
|
+
|
|
909
|
+
@builtins.property
|
|
910
|
+
def dimension(
|
|
911
|
+
self,
|
|
912
|
+
) -> typing.Optional[typing.List[MetricAlertCriteriaDimensionProp]]:
|
|
913
|
+
'''One or more dimensions.
|
|
914
|
+
|
|
915
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#dimension}
|
|
916
|
+
'''
|
|
917
|
+
result = self._values.get("dimension")
|
|
918
|
+
return typing.cast(typing.Optional[typing.List[MetricAlertCriteriaDimensionProp]], result)
|
|
919
|
+
|
|
920
|
+
@builtins.property
|
|
921
|
+
def skip_metric_validation(self) -> typing.Optional[builtins.bool]:
|
|
922
|
+
'''Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
|
|
923
|
+
|
|
924
|
+
:default: false.
|
|
925
|
+
|
|
926
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#skip_metric_validation}
|
|
927
|
+
'''
|
|
928
|
+
result = self._values.get("skip_metric_validation")
|
|
929
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
930
|
+
|
|
931
|
+
@builtins.property
|
|
932
|
+
def threshold(self) -> jsii.Number:
|
|
933
|
+
'''The threshold value for the metric that triggers the alert.
|
|
934
|
+
|
|
935
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#threshold}
|
|
936
|
+
'''
|
|
937
|
+
result = self._values.get("threshold")
|
|
938
|
+
assert result is not None, "Required property 'threshold' is missing"
|
|
939
|
+
return typing.cast(jsii.Number, result)
|
|
940
|
+
|
|
941
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
942
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
943
|
+
|
|
944
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
945
|
+
return not (rhs == self)
|
|
946
|
+
|
|
947
|
+
def __repr__(self) -> str:
|
|
948
|
+
return "MetricAlertCriteriaProp(%s)" % ", ".join(
|
|
949
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
950
|
+
)
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
@jsii.data_type(
|
|
954
|
+
jsii_type="@microsoft/terraform-cdk-constructs.azure_metricalert.MetricAlertDynamicCritiriaProps",
|
|
955
|
+
jsii_struct_bases=[MetricAlertCriteriaBaseProps],
|
|
956
|
+
name_mapping={
|
|
957
|
+
"aggregation": "aggregation",
|
|
958
|
+
"metric_name": "metricName",
|
|
959
|
+
"metric_namespace": "metricNamespace",
|
|
960
|
+
"operator": "operator",
|
|
961
|
+
"dimension": "dimension",
|
|
962
|
+
"skip_metric_validation": "skipMetricValidation",
|
|
963
|
+
"alert_sensitivity": "alertSensitivity",
|
|
964
|
+
"evaluation_failure_count": "evaluationFailureCount",
|
|
965
|
+
"evaluation_total_count": "evaluationTotalCount",
|
|
966
|
+
"ignore_data_before": "ignoreDataBefore",
|
|
967
|
+
},
|
|
968
|
+
)
|
|
969
|
+
class MetricAlertDynamicCritiriaProps(MetricAlertCriteriaBaseProps):
|
|
970
|
+
def __init__(
|
|
971
|
+
self,
|
|
972
|
+
*,
|
|
973
|
+
aggregation: builtins.str,
|
|
974
|
+
metric_name: builtins.str,
|
|
975
|
+
metric_namespace: builtins.str,
|
|
976
|
+
operator: builtins.str,
|
|
977
|
+
dimension: typing.Optional[typing.Sequence[typing.Union[MetricAlertCriteriaDimensionProp, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
978
|
+
skip_metric_validation: typing.Optional[builtins.bool] = None,
|
|
979
|
+
alert_sensitivity: builtins.str,
|
|
980
|
+
evaluation_failure_count: typing.Optional[jsii.Number] = None,
|
|
981
|
+
evaluation_total_count: typing.Optional[jsii.Number] = None,
|
|
982
|
+
ignore_data_before: typing.Optional[builtins.str] = None,
|
|
983
|
+
) -> None:
|
|
984
|
+
'''
|
|
985
|
+
:param aggregation: The aggregation type to apply to the metric. Possible values are Average, Count, Minimum, Maximum and Total.
|
|
986
|
+
:param metric_name: The name of the metric to monitor.
|
|
987
|
+
:param metric_namespace: The namespace of the metric.
|
|
988
|
+
:param operator: The operator to apply to the metric. Possible values are Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan and LessThanOrEqual.
|
|
989
|
+
:param dimension: One or more dimensions.
|
|
990
|
+
:param skip_metric_validation: Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Default: false.
|
|
991
|
+
:param alert_sensitivity: The extent of deviation required to trigger an alert. Possible values are Low, Medium and High.
|
|
992
|
+
:param evaluation_failure_count: The number of violations to trigger an alert. Should be smaller or equal to evaluation_total_count. Default: 4
|
|
993
|
+
:param evaluation_total_count: he number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (window_size) and the selected number of aggregated points. Default: 4
|
|
994
|
+
:param ignore_data_before: The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
|
|
995
|
+
|
|
996
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#dynamic_criteria}
|
|
997
|
+
:description: The dynamic criteria properties for a Metric Alert.
|
|
998
|
+
'''
|
|
999
|
+
if __debug__:
|
|
1000
|
+
type_hints = typing.get_type_hints(_typecheckingstub__1d030599e7ae14372ed150135a09a1fcf950eb248e6001aca2429d30a74f4a8d)
|
|
1001
|
+
check_type(argname="argument aggregation", value=aggregation, expected_type=type_hints["aggregation"])
|
|
1002
|
+
check_type(argname="argument metric_name", value=metric_name, expected_type=type_hints["metric_name"])
|
|
1003
|
+
check_type(argname="argument metric_namespace", value=metric_namespace, expected_type=type_hints["metric_namespace"])
|
|
1004
|
+
check_type(argname="argument operator", value=operator, expected_type=type_hints["operator"])
|
|
1005
|
+
check_type(argname="argument dimension", value=dimension, expected_type=type_hints["dimension"])
|
|
1006
|
+
check_type(argname="argument skip_metric_validation", value=skip_metric_validation, expected_type=type_hints["skip_metric_validation"])
|
|
1007
|
+
check_type(argname="argument alert_sensitivity", value=alert_sensitivity, expected_type=type_hints["alert_sensitivity"])
|
|
1008
|
+
check_type(argname="argument evaluation_failure_count", value=evaluation_failure_count, expected_type=type_hints["evaluation_failure_count"])
|
|
1009
|
+
check_type(argname="argument evaluation_total_count", value=evaluation_total_count, expected_type=type_hints["evaluation_total_count"])
|
|
1010
|
+
check_type(argname="argument ignore_data_before", value=ignore_data_before, expected_type=type_hints["ignore_data_before"])
|
|
1011
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
1012
|
+
"aggregation": aggregation,
|
|
1013
|
+
"metric_name": metric_name,
|
|
1014
|
+
"metric_namespace": metric_namespace,
|
|
1015
|
+
"operator": operator,
|
|
1016
|
+
"alert_sensitivity": alert_sensitivity,
|
|
1017
|
+
}
|
|
1018
|
+
if dimension is not None:
|
|
1019
|
+
self._values["dimension"] = dimension
|
|
1020
|
+
if skip_metric_validation is not None:
|
|
1021
|
+
self._values["skip_metric_validation"] = skip_metric_validation
|
|
1022
|
+
if evaluation_failure_count is not None:
|
|
1023
|
+
self._values["evaluation_failure_count"] = evaluation_failure_count
|
|
1024
|
+
if evaluation_total_count is not None:
|
|
1025
|
+
self._values["evaluation_total_count"] = evaluation_total_count
|
|
1026
|
+
if ignore_data_before is not None:
|
|
1027
|
+
self._values["ignore_data_before"] = ignore_data_before
|
|
1028
|
+
|
|
1029
|
+
@builtins.property
|
|
1030
|
+
def aggregation(self) -> builtins.str:
|
|
1031
|
+
'''The aggregation type to apply to the metric.
|
|
1032
|
+
|
|
1033
|
+
Possible values are Average, Count, Minimum, Maximum and Total.
|
|
1034
|
+
|
|
1035
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#aggregation}
|
|
1036
|
+
'''
|
|
1037
|
+
result = self._values.get("aggregation")
|
|
1038
|
+
assert result is not None, "Required property 'aggregation' is missing"
|
|
1039
|
+
return typing.cast(builtins.str, result)
|
|
1040
|
+
|
|
1041
|
+
@builtins.property
|
|
1042
|
+
def metric_name(self) -> builtins.str:
|
|
1043
|
+
'''The name of the metric to monitor.
|
|
1044
|
+
|
|
1045
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#metric_name}
|
|
1046
|
+
'''
|
|
1047
|
+
result = self._values.get("metric_name")
|
|
1048
|
+
assert result is not None, "Required property 'metric_name' is missing"
|
|
1049
|
+
return typing.cast(builtins.str, result)
|
|
1050
|
+
|
|
1051
|
+
@builtins.property
|
|
1052
|
+
def metric_namespace(self) -> builtins.str:
|
|
1053
|
+
'''The namespace of the metric.
|
|
1054
|
+
|
|
1055
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#metric_namespace}
|
|
1056
|
+
'''
|
|
1057
|
+
result = self._values.get("metric_namespace")
|
|
1058
|
+
assert result is not None, "Required property 'metric_namespace' is missing"
|
|
1059
|
+
return typing.cast(builtins.str, result)
|
|
1060
|
+
|
|
1061
|
+
@builtins.property
|
|
1062
|
+
def operator(self) -> builtins.str:
|
|
1063
|
+
'''The operator to apply to the metric.
|
|
1064
|
+
|
|
1065
|
+
Possible values are Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan and LessThanOrEqual.
|
|
1066
|
+
|
|
1067
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#operator}
|
|
1068
|
+
'''
|
|
1069
|
+
result = self._values.get("operator")
|
|
1070
|
+
assert result is not None, "Required property 'operator' is missing"
|
|
1071
|
+
return typing.cast(builtins.str, result)
|
|
1072
|
+
|
|
1073
|
+
@builtins.property
|
|
1074
|
+
def dimension(
|
|
1075
|
+
self,
|
|
1076
|
+
) -> typing.Optional[typing.List[MetricAlertCriteriaDimensionProp]]:
|
|
1077
|
+
'''One or more dimensions.
|
|
1078
|
+
|
|
1079
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#dimension}
|
|
1080
|
+
'''
|
|
1081
|
+
result = self._values.get("dimension")
|
|
1082
|
+
return typing.cast(typing.Optional[typing.List[MetricAlertCriteriaDimensionProp]], result)
|
|
1083
|
+
|
|
1084
|
+
@builtins.property
|
|
1085
|
+
def skip_metric_validation(self) -> typing.Optional[builtins.bool]:
|
|
1086
|
+
'''Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
|
|
1087
|
+
|
|
1088
|
+
:default: false.
|
|
1089
|
+
|
|
1090
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#skip_metric_validation}
|
|
1091
|
+
'''
|
|
1092
|
+
result = self._values.get("skip_metric_validation")
|
|
1093
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
1094
|
+
|
|
1095
|
+
@builtins.property
|
|
1096
|
+
def alert_sensitivity(self) -> builtins.str:
|
|
1097
|
+
'''The extent of deviation required to trigger an alert.
|
|
1098
|
+
|
|
1099
|
+
Possible values are Low, Medium and High.
|
|
1100
|
+
|
|
1101
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#alert_sensitivity}
|
|
1102
|
+
'''
|
|
1103
|
+
result = self._values.get("alert_sensitivity")
|
|
1104
|
+
assert result is not None, "Required property 'alert_sensitivity' is missing"
|
|
1105
|
+
return typing.cast(builtins.str, result)
|
|
1106
|
+
|
|
1107
|
+
@builtins.property
|
|
1108
|
+
def evaluation_failure_count(self) -> typing.Optional[jsii.Number]:
|
|
1109
|
+
'''The number of violations to trigger an alert.
|
|
1110
|
+
|
|
1111
|
+
Should be smaller or equal to evaluation_total_count.
|
|
1112
|
+
|
|
1113
|
+
:default: 4
|
|
1114
|
+
|
|
1115
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#evaluation_failure_count}
|
|
1116
|
+
'''
|
|
1117
|
+
result = self._values.get("evaluation_failure_count")
|
|
1118
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
1119
|
+
|
|
1120
|
+
@builtins.property
|
|
1121
|
+
def evaluation_total_count(self) -> typing.Optional[jsii.Number]:
|
|
1122
|
+
'''he number of aggregated lookback points.
|
|
1123
|
+
|
|
1124
|
+
The lookback time window is calculated based on the aggregation granularity (window_size) and the selected number of aggregated points.
|
|
1125
|
+
|
|
1126
|
+
:default: 4
|
|
1127
|
+
|
|
1128
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#evaluation_total_count}
|
|
1129
|
+
'''
|
|
1130
|
+
result = self._values.get("evaluation_total_count")
|
|
1131
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
1132
|
+
|
|
1133
|
+
@builtins.property
|
|
1134
|
+
def ignore_data_before(self) -> typing.Optional[builtins.str]:
|
|
1135
|
+
'''The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
|
|
1136
|
+
|
|
1137
|
+
:see: {@link https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html#ignore_data_before}
|
|
1138
|
+
'''
|
|
1139
|
+
result = self._values.get("ignore_data_before")
|
|
1140
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
1141
|
+
|
|
1142
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
1143
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
1144
|
+
|
|
1145
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
1146
|
+
return not (rhs == self)
|
|
1147
|
+
|
|
1148
|
+
def __repr__(self) -> str:
|
|
1149
|
+
return "MetricAlertDynamicCritiriaProps(%s)" % ", ".join(
|
|
1150
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
1151
|
+
)
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
__all__ = [
|
|
1155
|
+
"IBaseMetricAlertProps",
|
|
1156
|
+
"IMetricAlertProps",
|
|
1157
|
+
"MetricAlert",
|
|
1158
|
+
"MetricAlertActionProp",
|
|
1159
|
+
"MetricAlertCriteriaBaseProps",
|
|
1160
|
+
"MetricAlertCriteriaDimensionProp",
|
|
1161
|
+
"MetricAlertCriteriaProp",
|
|
1162
|
+
"MetricAlertDynamicCritiriaProps",
|
|
1163
|
+
]
|
|
1164
|
+
|
|
1165
|
+
publication.publish()
|
|
1166
|
+
|
|
1167
|
+
def _typecheckingstub__d9b6d2f05b6ed0d46af4ec9192122ef44c3980479c396d43304bb0b9b694e113(
|
|
1168
|
+
value: typing.Optional[builtins.bool],
|
|
1169
|
+
) -> None:
|
|
1170
|
+
"""Type checking stubs"""
|
|
1171
|
+
pass
|
|
1172
|
+
|
|
1173
|
+
def _typecheckingstub__a71a6bc41cbe01c48e85fc89a6e119390fa9f8a525e7cf56ded112c85d2ce1b4(
|
|
1174
|
+
value: typing.Optional[builtins.bool],
|
|
1175
|
+
) -> None:
|
|
1176
|
+
"""Type checking stubs"""
|
|
1177
|
+
pass
|
|
1178
|
+
|
|
1179
|
+
def _typecheckingstub__6121ecbd0831518b2ec58c88fba21c560e324250edb73d3cb548e7b87b63cb7a(
|
|
1180
|
+
value: typing.Optional[builtins.str],
|
|
1181
|
+
) -> None:
|
|
1182
|
+
"""Type checking stubs"""
|
|
1183
|
+
pass
|
|
1184
|
+
|
|
1185
|
+
def _typecheckingstub__4208080d1e6a948e5cd36c58ec3192a87a4670c52f57c2611997528c85acd7f0(
|
|
1186
|
+
value: typing.Optional[jsii.Number],
|
|
1187
|
+
) -> None:
|
|
1188
|
+
"""Type checking stubs"""
|
|
1189
|
+
pass
|
|
1190
|
+
|
|
1191
|
+
def _typecheckingstub__32d092155070280bb1f6c612ff5cfd8100865141ec1f19899057122299f11708(
|
|
1192
|
+
value: typing.Optional[builtins.str],
|
|
1193
|
+
) -> None:
|
|
1194
|
+
"""Type checking stubs"""
|
|
1195
|
+
pass
|
|
1196
|
+
|
|
1197
|
+
def _typecheckingstub__89a31dd72d07a3fb3ea9f11c966fd677dff2f202fa495d954aa9d15a60a7539b(
|
|
1198
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
1199
|
+
id: builtins.str,
|
|
1200
|
+
props: IMetricAlertProps,
|
|
1201
|
+
) -> None:
|
|
1202
|
+
"""Type checking stubs"""
|
|
1203
|
+
pass
|
|
1204
|
+
|
|
1205
|
+
def _typecheckingstub__c10e6a840860f6b4069b766a02a280d1a0fbeb3f59e8d4149c18a3a463743083(
|
|
1206
|
+
*,
|
|
1207
|
+
action_group_id: typing.Sequence[builtins.str],
|
|
1208
|
+
) -> None:
|
|
1209
|
+
"""Type checking stubs"""
|
|
1210
|
+
pass
|
|
1211
|
+
|
|
1212
|
+
def _typecheckingstub__6d07a7654959ce4d1f3e2cfa72b5acc5537f57d967a4d561b13ea4c9114815c6(
|
|
1213
|
+
*,
|
|
1214
|
+
aggregation: builtins.str,
|
|
1215
|
+
metric_name: builtins.str,
|
|
1216
|
+
metric_namespace: builtins.str,
|
|
1217
|
+
operator: builtins.str,
|
|
1218
|
+
dimension: typing.Optional[typing.Sequence[typing.Union[MetricAlertCriteriaDimensionProp, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1219
|
+
skip_metric_validation: typing.Optional[builtins.bool] = None,
|
|
1220
|
+
) -> None:
|
|
1221
|
+
"""Type checking stubs"""
|
|
1222
|
+
pass
|
|
1223
|
+
|
|
1224
|
+
def _typecheckingstub__fad1a3301130bfb3fc3685343a7ae98a55d316b0f52af7dc52f87c22204f7e84(
|
|
1225
|
+
*,
|
|
1226
|
+
name: builtins.str,
|
|
1227
|
+
operator: builtins.str,
|
|
1228
|
+
values: typing.Sequence[builtins.str],
|
|
1229
|
+
) -> None:
|
|
1230
|
+
"""Type checking stubs"""
|
|
1231
|
+
pass
|
|
1232
|
+
|
|
1233
|
+
def _typecheckingstub__a8510797c51c82823528fa3e989c82b1aa00ee5541f39bca355ff9b7797b0d91(
|
|
1234
|
+
*,
|
|
1235
|
+
aggregation: builtins.str,
|
|
1236
|
+
metric_name: builtins.str,
|
|
1237
|
+
metric_namespace: builtins.str,
|
|
1238
|
+
operator: builtins.str,
|
|
1239
|
+
dimension: typing.Optional[typing.Sequence[typing.Union[MetricAlertCriteriaDimensionProp, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1240
|
+
skip_metric_validation: typing.Optional[builtins.bool] = None,
|
|
1241
|
+
threshold: jsii.Number,
|
|
1242
|
+
) -> None:
|
|
1243
|
+
"""Type checking stubs"""
|
|
1244
|
+
pass
|
|
1245
|
+
|
|
1246
|
+
def _typecheckingstub__1d030599e7ae14372ed150135a09a1fcf950eb248e6001aca2429d30a74f4a8d(
|
|
1247
|
+
*,
|
|
1248
|
+
aggregation: builtins.str,
|
|
1249
|
+
metric_name: builtins.str,
|
|
1250
|
+
metric_namespace: builtins.str,
|
|
1251
|
+
operator: builtins.str,
|
|
1252
|
+
dimension: typing.Optional[typing.Sequence[typing.Union[MetricAlertCriteriaDimensionProp, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1253
|
+
skip_metric_validation: typing.Optional[builtins.bool] = None,
|
|
1254
|
+
alert_sensitivity: builtins.str,
|
|
1255
|
+
evaluation_failure_count: typing.Optional[jsii.Number] = None,
|
|
1256
|
+
evaluation_total_count: typing.Optional[jsii.Number] = None,
|
|
1257
|
+
ignore_data_before: typing.Optional[builtins.str] = None,
|
|
1258
|
+
) -> None:
|
|
1259
|
+
"""Type checking stubs"""
|
|
1260
|
+
pass
|