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.
Files changed (27) hide show
  1. microsoft_cdktfconstructs/__init__.py +217 -0
  2. microsoft_cdktfconstructs/_jsii/__init__.py +31 -0
  3. microsoft_cdktfconstructs/_jsii/terraform-cdk-constructs@0.0.3-pre.11.jsii.tgz +0 -0
  4. microsoft_cdktfconstructs/azure_applicationgateway/__init__.py +823 -0
  5. microsoft_cdktfconstructs/azure_applicationinsights/__init__.py +397 -0
  6. microsoft_cdktfconstructs/azure_containerregistry/__init__.py +320 -0
  7. microsoft_cdktfconstructs/azure_eventhub/__init__.py +2213 -0
  8. microsoft_cdktfconstructs/azure_functionapp/__init__.py +908 -0
  9. microsoft_cdktfconstructs/azure_keyvault/__init__.py +1982 -0
  10. microsoft_cdktfconstructs/azure_kubernetes/__init__.py +400 -0
  11. microsoft_cdktfconstructs/azure_kusto/__init__.py +2485 -0
  12. microsoft_cdktfconstructs/azure_loganalytics/__init__.py +652 -0
  13. microsoft_cdktfconstructs/azure_metricalert/__init__.py +1260 -0
  14. microsoft_cdktfconstructs/azure_networksecuritygroup/__init__.py +1742 -0
  15. microsoft_cdktfconstructs/azure_queryrulealert/__init__.py +1189 -0
  16. microsoft_cdktfconstructs/azure_resourcegroup/__init__.py +320 -0
  17. microsoft_cdktfconstructs/azure_storageaccount/__init__.py +1910 -0
  18. microsoft_cdktfconstructs/azure_virtualmachine/__init__.py +1460 -0
  19. microsoft_cdktfconstructs/azure_virtualmachinescaleset/__init__.py +1185 -0
  20. microsoft_cdktfconstructs/azure_virtualnetwork/__init__.py +707 -0
  21. microsoft_cdktfconstructs/core_azure/__init__.py +931 -0
  22. microsoft_cdktfconstructs/py.typed +1 -0
  23. microsoft_cdktfconstructs-0.0.3.dev11.dist-info/LICENSE +19 -0
  24. microsoft_cdktfconstructs-0.0.3.dev11.dist-info/METADATA +188 -0
  25. microsoft_cdktfconstructs-0.0.3.dev11.dist-info/RECORD +27 -0
  26. microsoft_cdktfconstructs-0.0.3.dev11.dist-info/WHEEL +5 -0
  27. microsoft_cdktfconstructs-0.0.3.dev11.dist-info/top_level.txt +1 -0
@@ -0,0 +1,397 @@
1
+ '''
2
+ # Azure Application Insights Construct
3
+
4
+ This class represents an Application Insights resource in Azure. It provides a convenient way to manage Azure Application Insights resources.
5
+
6
+ ## What is Azure Application Insights?
7
+
8
+ Azure Application Insights is an extensible Application Performance Management (APM) service for developers and DevOps professionals. Use it to monitor your live applications. It automatically detects performance anomalies, and includes powerful analytics tools to help you diagnose issues and to understand what users actually do with your app.
9
+
10
+ You can learn more about Azure Application Insights in the [official Azure documentation](https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview).
11
+
12
+ ## Application Insights Best Practices
13
+
14
+ * Enable Application Insights during development and use it for all environments, including production.
15
+ * Use multiple Application Insights resources for different environments and use Azure resource tags to filter and identify them.
16
+ * Leverage the data retention policy to retain data according to your requirements.
17
+
18
+ ## Application Insights Class Properties
19
+
20
+ This class has several properties that control the Application Insights resource's behaviour:
21
+
22
+ * `name`: The name of the Application Insights resource.
23
+ * `location`: The Azure Region where the Application Insights resource will be deployed.
24
+ * `resource_group_name`: The name of the Azure Resource Group.
25
+ * `retention_in_days`: The number of days of retention.
26
+ * `tags`: The tags to assign to the Application Insights resource.
27
+ * `application_type`: The Application type.
28
+ * `daily_data_cap_in_gb`: The Application Insights daily data cap in GB.
29
+ * `daily_data_cap_notification_disabled`: The Application Insights daily data cap notifications disabled.
30
+ * `workspace_id`: The id of the Log Analytics Workspace.
31
+
32
+ ## Deploying the Application Insights
33
+
34
+ You can deploy an Application Insights resource using this class like so:
35
+
36
+ ```python
37
+ const azureAppInsights = new AzureApplicationInsights(this, 'myAppInsights', {
38
+ name: 'myAppInsights',
39
+ location: 'West US',
40
+ resource_group_name: 'myResourceGroup',
41
+ application_type: 'web',
42
+ daily_data_cap_in_gb: 10,
43
+ daily_data_cap_notification_disabled: false,
44
+ retention_in_days: 90,
45
+ workspace_id: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
46
+ tags: {
47
+ 'env': 'production',
48
+ },
49
+ });
50
+ ```
51
+
52
+ This code will create a new Application Insights resource named myAppInsights in the West US Azure region with a production environment tag. The resource belongs to the resource group myResourceGroup, it has a daily data cap of 10 GB, sends notifications when the daily data cap is reached, retains data for 90 days, and uses the provided workspace ID.
53
+ '''
54
+ from pkgutil import extend_path
55
+ __path__ = extend_path(__path__, __name__)
56
+
57
+ import abc
58
+ import builtins
59
+ import datetime
60
+ import enum
61
+ import typing
62
+
63
+ import jsii
64
+ import publication
65
+ import typing_extensions
66
+
67
+ from typeguard import check_type
68
+
69
+ from .._jsii import *
70
+
71
+ import cdktf_cdktf_provider_azurerm.resource_group as _cdktf_cdktf_provider_azurerm_resource_group_92bbcedf
72
+ import constructs as _constructs_77d1e7e8
73
+ from ..core_azure import AzureResource as _AzureResource_74eec1c4
74
+
75
+
76
+ class AppInsights(
77
+ _AzureResource_74eec1c4,
78
+ metaclass=jsii.JSIIMeta,
79
+ jsii_type="@microsoft/terraform-cdk-constructs.azure_applicationinsights.AppInsights",
80
+ ):
81
+ def __init__(
82
+ self,
83
+ scope: _constructs_77d1e7e8.Construct,
84
+ id: builtins.str,
85
+ *,
86
+ application_type: builtins.str,
87
+ location: builtins.str,
88
+ name: builtins.str,
89
+ daily_data_cap_in_gb: typing.Optional[jsii.Number] = None,
90
+ daily_data_cap_notification_disabled: typing.Optional[builtins.bool] = None,
91
+ resource_group: typing.Optional[_cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup] = None,
92
+ retention_in_days: typing.Optional[jsii.Number] = None,
93
+ tags: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
94
+ workspace_id: typing.Optional[builtins.str] = None,
95
+ ) -> None:
96
+ '''Constructs a new Azure Application Insights resource.
97
+
98
+ :param scope: - The scope in which to define this construct.
99
+ :param id: - The ID of this construct.
100
+ :param application_type: The Application type.
101
+ :param location: The Azure Region to deploy.
102
+ :param name: The name of the Application Insights resource.
103
+ :param daily_data_cap_in_gb: The Application Insights daily data cap in GB.
104
+ :param daily_data_cap_notification_disabled: The Application Insights daily data cap notifications disabled.
105
+ :param resource_group: An optional reference to the resource group in which to deploy the Application Insights. If not provided, the Application Insights will be deployed in the default resource group.
106
+ :param retention_in_days: The number of days of retention. Possible values are 30, 60, 90, 120, 180, 270, 365, 550 or 730. Defaults to 90. Default: 90
107
+ :param tags: The tags to assign to the Application Insights resource.
108
+ :param workspace_id: The id of the Log Analytics Workspace. Default: - If no workspace id is provided, a new one will be created automatically in the same resource group. The name will be the same as the Application Insights resource with a "-la" suffix.
109
+ '''
110
+ if __debug__:
111
+ type_hints = typing.get_type_hints(_typecheckingstub__7d4b8c71ca92596f9110e479740b5f222f59c2481e089dc27fe01d85d3ddfb96)
112
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
113
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
114
+ props = AppInsightsProps(
115
+ application_type=application_type,
116
+ location=location,
117
+ name=name,
118
+ daily_data_cap_in_gb=daily_data_cap_in_gb,
119
+ daily_data_cap_notification_disabled=daily_data_cap_notification_disabled,
120
+ resource_group=resource_group,
121
+ retention_in_days=retention_in_days,
122
+ tags=tags,
123
+ workspace_id=workspace_id,
124
+ )
125
+
126
+ jsii.create(self.__class__, self, [scope, id, props])
127
+
128
+ @jsii.member(jsii_name="saveIKeyToKeyVault")
129
+ def save_i_key_to_key_vault(
130
+ self,
131
+ key_vault_id: builtins.str,
132
+ key_vault_secret_name: typing.Optional[builtins.str] = None,
133
+ ) -> None:
134
+ '''Saves the Application Insights instrumentation key to an Azure Key Vault.
135
+
136
+ This method creates a new secret in the specified Azure Key Vault with the
137
+ instrumentation key of the Application Insights resource. This enables secure storage
138
+ and management of the instrumentation key, facilitating secure access across various
139
+ Azure services.
140
+
141
+ :param key_vault_id: - The unique identifier of the Azure Key Vault where the secret will be stored.
142
+ :param key_vault_secret_name: - The name of the secret within the Key Vault. Defaults to 'instrumentation-key'. This name can be used to retrieve the secret in client applications. Example usage:: appInsightsInstance.saveIKeyToKeyVault('my-key-vault-id');
143
+ '''
144
+ if __debug__:
145
+ type_hints = typing.get_type_hints(_typecheckingstub__7ab25147fd544a8a1c78f6c8c150e0eea1424fbb238afb85b75d0a9ecde637ad)
146
+ check_type(argname="argument key_vault_id", value=key_vault_id, expected_type=type_hints["key_vault_id"])
147
+ check_type(argname="argument key_vault_secret_name", value=key_vault_secret_name, expected_type=type_hints["key_vault_secret_name"])
148
+ return typing.cast(None, jsii.invoke(self, "saveIKeyToKeyVault", [key_vault_id, key_vault_secret_name]))
149
+
150
+ @builtins.property
151
+ @jsii.member(jsii_name="props")
152
+ def props(self) -> "AppInsightsProps":
153
+ return typing.cast("AppInsightsProps", jsii.get(self, "props"))
154
+
155
+ @builtins.property
156
+ @jsii.member(jsii_name="id")
157
+ def id(self) -> builtins.str:
158
+ return typing.cast(builtins.str, jsii.get(self, "id"))
159
+
160
+ @id.setter
161
+ def id(self, value: builtins.str) -> None:
162
+ if __debug__:
163
+ type_hints = typing.get_type_hints(_typecheckingstub__97fa5018455ab90c6bbc179025dd90c7ae8faf283ee2c884829a94b7abeac7c5)
164
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
165
+ jsii.set(self, "id", value)
166
+
167
+ @builtins.property
168
+ @jsii.member(jsii_name="resourceGroup")
169
+ def resource_group(
170
+ self,
171
+ ) -> _cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup:
172
+ return typing.cast(_cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup, jsii.get(self, "resourceGroup"))
173
+
174
+ @resource_group.setter
175
+ def resource_group(
176
+ self,
177
+ value: _cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup,
178
+ ) -> None:
179
+ if __debug__:
180
+ type_hints = typing.get_type_hints(_typecheckingstub__e275638079dae2995cb8ad8bbbdd8b6897d70abca72db4f333367f1fe25fc7f0)
181
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
182
+ jsii.set(self, "resourceGroup", value)
183
+
184
+
185
+ @jsii.data_type(
186
+ jsii_type="@microsoft/terraform-cdk-constructs.azure_applicationinsights.AppInsightsProps",
187
+ jsii_struct_bases=[],
188
+ name_mapping={
189
+ "application_type": "applicationType",
190
+ "location": "location",
191
+ "name": "name",
192
+ "daily_data_cap_in_gb": "dailyDataCapInGb",
193
+ "daily_data_cap_notification_disabled": "dailyDataCapNotificationDisabled",
194
+ "resource_group": "resourceGroup",
195
+ "retention_in_days": "retentionInDays",
196
+ "tags": "tags",
197
+ "workspace_id": "workspaceId",
198
+ },
199
+ )
200
+ class AppInsightsProps:
201
+ def __init__(
202
+ self,
203
+ *,
204
+ application_type: builtins.str,
205
+ location: builtins.str,
206
+ name: builtins.str,
207
+ daily_data_cap_in_gb: typing.Optional[jsii.Number] = None,
208
+ daily_data_cap_notification_disabled: typing.Optional[builtins.bool] = None,
209
+ resource_group: typing.Optional[_cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup] = None,
210
+ retention_in_days: typing.Optional[jsii.Number] = None,
211
+ tags: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
212
+ workspace_id: typing.Optional[builtins.str] = None,
213
+ ) -> None:
214
+ '''Properties for the resource group.
215
+
216
+ :param application_type: The Application type.
217
+ :param location: The Azure Region to deploy.
218
+ :param name: The name of the Application Insights resource.
219
+ :param daily_data_cap_in_gb: The Application Insights daily data cap in GB.
220
+ :param daily_data_cap_notification_disabled: The Application Insights daily data cap notifications disabled.
221
+ :param resource_group: An optional reference to the resource group in which to deploy the Application Insights. If not provided, the Application Insights will be deployed in the default resource group.
222
+ :param retention_in_days: The number of days of retention. Possible values are 30, 60, 90, 120, 180, 270, 365, 550 or 730. Defaults to 90. Default: 90
223
+ :param tags: The tags to assign to the Application Insights resource.
224
+ :param workspace_id: The id of the Log Analytics Workspace. Default: - If no workspace id is provided, a new one will be created automatically in the same resource group. The name will be the same as the Application Insights resource with a "-la" suffix.
225
+ '''
226
+ if __debug__:
227
+ type_hints = typing.get_type_hints(_typecheckingstub__3cd1f93969139bc6d1064ad804b9d35fbafea5d6e73b90732b004f5fe5d03a04)
228
+ check_type(argname="argument application_type", value=application_type, expected_type=type_hints["application_type"])
229
+ check_type(argname="argument location", value=location, expected_type=type_hints["location"])
230
+ check_type(argname="argument name", value=name, expected_type=type_hints["name"])
231
+ check_type(argname="argument daily_data_cap_in_gb", value=daily_data_cap_in_gb, expected_type=type_hints["daily_data_cap_in_gb"])
232
+ check_type(argname="argument daily_data_cap_notification_disabled", value=daily_data_cap_notification_disabled, expected_type=type_hints["daily_data_cap_notification_disabled"])
233
+ check_type(argname="argument resource_group", value=resource_group, expected_type=type_hints["resource_group"])
234
+ check_type(argname="argument retention_in_days", value=retention_in_days, expected_type=type_hints["retention_in_days"])
235
+ check_type(argname="argument tags", value=tags, expected_type=type_hints["tags"])
236
+ check_type(argname="argument workspace_id", value=workspace_id, expected_type=type_hints["workspace_id"])
237
+ self._values: typing.Dict[builtins.str, typing.Any] = {
238
+ "application_type": application_type,
239
+ "location": location,
240
+ "name": name,
241
+ }
242
+ if daily_data_cap_in_gb is not None:
243
+ self._values["daily_data_cap_in_gb"] = daily_data_cap_in_gb
244
+ if daily_data_cap_notification_disabled is not None:
245
+ self._values["daily_data_cap_notification_disabled"] = daily_data_cap_notification_disabled
246
+ if resource_group is not None:
247
+ self._values["resource_group"] = resource_group
248
+ if retention_in_days is not None:
249
+ self._values["retention_in_days"] = retention_in_days
250
+ if tags is not None:
251
+ self._values["tags"] = tags
252
+ if workspace_id is not None:
253
+ self._values["workspace_id"] = workspace_id
254
+
255
+ @builtins.property
256
+ def application_type(self) -> builtins.str:
257
+ '''The Application type.'''
258
+ result = self._values.get("application_type")
259
+ assert result is not None, "Required property 'application_type' is missing"
260
+ return typing.cast(builtins.str, result)
261
+
262
+ @builtins.property
263
+ def location(self) -> builtins.str:
264
+ '''The Azure Region to deploy.'''
265
+ result = self._values.get("location")
266
+ assert result is not None, "Required property 'location' is missing"
267
+ return typing.cast(builtins.str, result)
268
+
269
+ @builtins.property
270
+ def name(self) -> builtins.str:
271
+ '''The name of the Application Insights resource.'''
272
+ result = self._values.get("name")
273
+ assert result is not None, "Required property 'name' is missing"
274
+ return typing.cast(builtins.str, result)
275
+
276
+ @builtins.property
277
+ def daily_data_cap_in_gb(self) -> typing.Optional[jsii.Number]:
278
+ '''The Application Insights daily data cap in GB.'''
279
+ result = self._values.get("daily_data_cap_in_gb")
280
+ return typing.cast(typing.Optional[jsii.Number], result)
281
+
282
+ @builtins.property
283
+ def daily_data_cap_notification_disabled(self) -> typing.Optional[builtins.bool]:
284
+ '''The Application Insights daily data cap notifications disabled.'''
285
+ result = self._values.get("daily_data_cap_notification_disabled")
286
+ return typing.cast(typing.Optional[builtins.bool], result)
287
+
288
+ @builtins.property
289
+ def resource_group(
290
+ self,
291
+ ) -> typing.Optional[_cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup]:
292
+ '''An optional reference to the resource group in which to deploy the Application Insights.
293
+
294
+ If not provided, the Application Insights will be deployed in the default resource group.
295
+ '''
296
+ result = self._values.get("resource_group")
297
+ return typing.cast(typing.Optional[_cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup], result)
298
+
299
+ @builtins.property
300
+ def retention_in_days(self) -> typing.Optional[jsii.Number]:
301
+ '''The number of days of retention.
302
+
303
+ Possible values are 30, 60, 90, 120, 180, 270, 365, 550 or 730. Defaults to 90.
304
+
305
+ :default: 90
306
+ '''
307
+ result = self._values.get("retention_in_days")
308
+ return typing.cast(typing.Optional[jsii.Number], result)
309
+
310
+ @builtins.property
311
+ def tags(self) -> typing.Optional[typing.Mapping[builtins.str, builtins.str]]:
312
+ '''The tags to assign to the Application Insights resource.'''
313
+ result = self._values.get("tags")
314
+ return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
315
+
316
+ @builtins.property
317
+ def workspace_id(self) -> typing.Optional[builtins.str]:
318
+ '''The id of the Log Analytics Workspace.
319
+
320
+ :default:
321
+
322
+ - If no workspace id is provided, a new one will be created automatically
323
+ in the same resource group. The name will be the same as the Application Insights
324
+ resource with a "-la" suffix.
325
+ '''
326
+ result = self._values.get("workspace_id")
327
+ return typing.cast(typing.Optional[builtins.str], result)
328
+
329
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
330
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
331
+
332
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
333
+ return not (rhs == self)
334
+
335
+ def __repr__(self) -> str:
336
+ return "AppInsightsProps(%s)" % ", ".join(
337
+ k + "=" + repr(v) for k, v in self._values.items()
338
+ )
339
+
340
+
341
+ __all__ = [
342
+ "AppInsights",
343
+ "AppInsightsProps",
344
+ ]
345
+
346
+ publication.publish()
347
+
348
+ def _typecheckingstub__7d4b8c71ca92596f9110e479740b5f222f59c2481e089dc27fe01d85d3ddfb96(
349
+ scope: _constructs_77d1e7e8.Construct,
350
+ id: builtins.str,
351
+ *,
352
+ application_type: builtins.str,
353
+ location: builtins.str,
354
+ name: builtins.str,
355
+ daily_data_cap_in_gb: typing.Optional[jsii.Number] = None,
356
+ daily_data_cap_notification_disabled: typing.Optional[builtins.bool] = None,
357
+ resource_group: typing.Optional[_cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup] = None,
358
+ retention_in_days: typing.Optional[jsii.Number] = None,
359
+ tags: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
360
+ workspace_id: typing.Optional[builtins.str] = None,
361
+ ) -> None:
362
+ """Type checking stubs"""
363
+ pass
364
+
365
+ def _typecheckingstub__7ab25147fd544a8a1c78f6c8c150e0eea1424fbb238afb85b75d0a9ecde637ad(
366
+ key_vault_id: builtins.str,
367
+ key_vault_secret_name: typing.Optional[builtins.str] = None,
368
+ ) -> None:
369
+ """Type checking stubs"""
370
+ pass
371
+
372
+ def _typecheckingstub__97fa5018455ab90c6bbc179025dd90c7ae8faf283ee2c884829a94b7abeac7c5(
373
+ value: builtins.str,
374
+ ) -> None:
375
+ """Type checking stubs"""
376
+ pass
377
+
378
+ def _typecheckingstub__e275638079dae2995cb8ad8bbbdd8b6897d70abca72db4f333367f1fe25fc7f0(
379
+ value: _cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup,
380
+ ) -> None:
381
+ """Type checking stubs"""
382
+ pass
383
+
384
+ def _typecheckingstub__3cd1f93969139bc6d1064ad804b9d35fbafea5d6e73b90732b004f5fe5d03a04(
385
+ *,
386
+ application_type: builtins.str,
387
+ location: builtins.str,
388
+ name: builtins.str,
389
+ daily_data_cap_in_gb: typing.Optional[jsii.Number] = None,
390
+ daily_data_cap_notification_disabled: typing.Optional[builtins.bool] = None,
391
+ resource_group: typing.Optional[_cdktf_cdktf_provider_azurerm_resource_group_92bbcedf.ResourceGroup] = None,
392
+ retention_in_days: typing.Optional[jsii.Number] = None,
393
+ tags: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
394
+ workspace_id: typing.Optional[builtins.str] = None,
395
+ ) -> None:
396
+ """Type checking stubs"""
397
+ pass