pulumi-newrelic 5.21.0a1710157101__py3-none-any.whl → 5.39.0a1736849617__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. pulumi_newrelic/__init__.py +9 -0
  2. pulumi_newrelic/_inputs.py +7153 -461
  3. pulumi_newrelic/_utilities.py +41 -5
  4. pulumi_newrelic/account_management.py +11 -6
  5. pulumi_newrelic/alert_channel.py +116 -127
  6. pulumi_newrelic/alert_condition.py +116 -129
  7. pulumi_newrelic/alert_muting_rule.py +128 -76
  8. pulumi_newrelic/alert_policy.py +78 -75
  9. pulumi_newrelic/alert_policy_channel.py +77 -68
  10. pulumi_newrelic/api_access_key.py +45 -28
  11. pulumi_newrelic/browser_application.py +77 -78
  12. pulumi_newrelic/cloud/_inputs.py +2527 -1082
  13. pulumi_newrelic/cloud/aws_govcloud_integrations.py +133 -128
  14. pulumi_newrelic/cloud/aws_govcloud_link_account.py +23 -20
  15. pulumi_newrelic/cloud/aws_integrations.py +298 -1326
  16. pulumi_newrelic/cloud/aws_link_account.py +23 -20
  17. pulumi_newrelic/cloud/azure_integrations.py +521 -483
  18. pulumi_newrelic/cloud/azure_link_account.py +34 -31
  19. pulumi_newrelic/cloud/gcp_integrations.py +341 -322
  20. pulumi_newrelic/cloud/gcp_link_account.py +23 -20
  21. pulumi_newrelic/cloud/outputs.py +327 -1072
  22. pulumi_newrelic/config/__init__.pyi +6 -1
  23. pulumi_newrelic/config/vars.py +7 -2
  24. pulumi_newrelic/data_partition_rule.py +19 -18
  25. pulumi_newrelic/entity_tags.py +32 -31
  26. pulumi_newrelic/events_to_metrics_rule.py +23 -20
  27. pulumi_newrelic/get_account.py +24 -16
  28. pulumi_newrelic/get_alert_channel.py +26 -13
  29. pulumi_newrelic/get_alert_policy.py +35 -12
  30. pulumi_newrelic/get_application.py +39 -31
  31. pulumi_newrelic/get_authentication_domain.py +17 -13
  32. pulumi_newrelic/get_cloud_account.py +26 -18
  33. pulumi_newrelic/get_entity.py +90 -147
  34. pulumi_newrelic/get_group.py +58 -13
  35. pulumi_newrelic/get_key_transaction.py +109 -34
  36. pulumi_newrelic/get_notification_destination.py +64 -14
  37. pulumi_newrelic/get_obfuscation_expression.py +36 -28
  38. pulumi_newrelic/get_service_level_alert_helper.py +135 -117
  39. pulumi_newrelic/get_test_grok_pattern.py +29 -18
  40. pulumi_newrelic/get_user.py +17 -9
  41. pulumi_newrelic/group.py +5 -146
  42. pulumi_newrelic/infra_alert_condition.py +160 -167
  43. pulumi_newrelic/insights/_inputs.py +43 -0
  44. pulumi_newrelic/insights/event.py +48 -47
  45. pulumi_newrelic/insights/outputs.py +5 -0
  46. pulumi_newrelic/key_transaction.py +464 -0
  47. pulumi_newrelic/log_parsing_rule.py +25 -24
  48. pulumi_newrelic/monitor_downtime.py +211 -225
  49. pulumi_newrelic/notification_channel.py +381 -366
  50. pulumi_newrelic/notification_destination.py +192 -54
  51. pulumi_newrelic/nrql_alert_condition.py +345 -262
  52. pulumi_newrelic/nrql_drop_rule.py +31 -30
  53. pulumi_newrelic/obfuscation_expression.py +23 -20
  54. pulumi_newrelic/obfuscation_rule.py +38 -33
  55. pulumi_newrelic/one_dashboard.py +29 -24
  56. pulumi_newrelic/one_dashboard_json.py +19 -14
  57. pulumi_newrelic/one_dashboard_raw.py +110 -105
  58. pulumi_newrelic/outputs.py +2446 -245
  59. pulumi_newrelic/plugins/_inputs.py +145 -10
  60. pulumi_newrelic/plugins/application_settings.py +25 -36
  61. pulumi_newrelic/plugins/outputs.py +15 -10
  62. pulumi_newrelic/plugins/workload.py +215 -92
  63. pulumi_newrelic/provider.py +27 -33
  64. pulumi_newrelic/pulumi-plugin.json +2 -1
  65. pulumi_newrelic/service_level.py +185 -186
  66. pulumi_newrelic/synthetics/_inputs.py +159 -2
  67. pulumi_newrelic/synthetics/alert_condition.py +87 -98
  68. pulumi_newrelic/synthetics/broken_links_monitor.py +216 -99
  69. pulumi_newrelic/synthetics/cert_check_monitor.py +219 -100
  70. pulumi_newrelic/synthetics/get_private_location.py +34 -30
  71. pulumi_newrelic/synthetics/get_secure_credential.py +24 -16
  72. pulumi_newrelic/synthetics/monitor.py +348 -193
  73. pulumi_newrelic/synthetics/multi_location_alert_condition.py +105 -100
  74. pulumi_newrelic/synthetics/outputs.py +7 -2
  75. pulumi_newrelic/synthetics/private_location.py +25 -20
  76. pulumi_newrelic/synthetics/script_monitor.py +317 -182
  77. pulumi_newrelic/synthetics/secure_credential.py +23 -22
  78. pulumi_newrelic/synthetics/step_monitor.py +405 -100
  79. pulumi_newrelic/user.py +13 -10
  80. pulumi_newrelic/workflow.py +209 -196
  81. {pulumi_newrelic-5.21.0a1710157101.dist-info → pulumi_newrelic-5.39.0a1736849617.dist-info}/METADATA +7 -6
  82. pulumi_newrelic-5.39.0a1736849617.dist-info/RECORD +90 -0
  83. {pulumi_newrelic-5.21.0a1710157101.dist-info → pulumi_newrelic-5.39.0a1736849617.dist-info}/WHEEL +1 -1
  84. pulumi_newrelic-5.21.0a1710157101.dist-info/RECORD +0 -89
  85. {pulumi_newrelic-5.21.0a1710157101.dist-info → pulumi_newrelic-5.39.0a1736849617.dist-info}/top_level.txt +0 -0
@@ -4,9 +4,14 @@
4
4
 
5
5
  import copy
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
10
  from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
10
15
  from . import _utilities
11
16
 
12
17
  __all__ = [
@@ -170,7 +175,6 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
170
175
 
171
176
  Firstly set up your service level objective, we recommend using local variables for the `target` and `time_window.rolling.count`, as they are also necessary for the helper.
172
177
 
173
- <!--Start PulumiCodeChooser -->
174
178
  ```python
175
179
  import pulumi
176
180
  import pulumi_newrelic as newrelic
@@ -179,104 +183,102 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
179
183
  foo_period = 28
180
184
  foo = newrelic.ServiceLevel("foo",
181
185
  guid="MXxBUE18QVBQTElDQVRJT058MQ",
186
+ name="Latency",
182
187
  description="Proportion of requests that are served faster than a threshold.",
183
- events=newrelic.ServiceLevelEventsArgs(
184
- account_id=12345678,
185
- valid_events=newrelic.ServiceLevelEventsValidEventsArgs(
186
- from_="Transaction",
187
- where="appName = 'Example application' AND (transactionType='Web')",
188
- ),
189
- bad_events=newrelic.ServiceLevelEventsBadEventsArgs(
190
- from_="Transaction",
191
- where="appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
192
- ),
193
- ),
194
- objective=newrelic.ServiceLevelObjectiveArgs(
195
- target=foo_target,
196
- time_window=newrelic.ServiceLevelObjectiveTimeWindowArgs(
197
- rolling=newrelic.ServiceLevelObjectiveTimeWindowRollingArgs(
198
- count=foo_period,
199
- unit="DAY",
200
- ),
201
- ),
202
- ))
188
+ events={
189
+ "account_id": "12345678",
190
+ "valid_events": {
191
+ "from_": "Transaction",
192
+ "where": "appName = 'Example application' AND (transactionType='Web')",
193
+ },
194
+ "bad_events": {
195
+ "from_": "Transaction",
196
+ "where": "appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
197
+ },
198
+ },
199
+ objective={
200
+ "target": foo_target,
201
+ "time_window": {
202
+ "rolling": {
203
+ "count": foo_period,
204
+ "unit": "DAY",
205
+ },
206
+ },
207
+ })
203
208
  ```
204
- <!--End PulumiCodeChooser -->
205
209
  Then use the helper to obtain the necessary fields to set up an alert on that Service Level.
206
210
  Note that the Service Level was set up using bad events, that's why `is_bad_events` is set to `true`.
207
211
  If the Service Level was configured with good events that would be unnecessary as the field defaults to `false`.
208
212
 
209
213
  Here is an example of a `slow_burn` alert.
210
214
 
211
- <!--Start PulumiCodeChooser -->
212
215
  ```python
213
216
  import pulumi
214
217
  import pulumi_newrelic as newrelic
215
218
 
216
219
  foo_slow_burn = newrelic.get_service_level_alert_helper(alert_type="slow_burn",
217
- sli_guid=newrelic_service_level["foo"]["sli_guid"],
218
- slo_target=local["foo_target"],
219
- slo_period=local["foo_period"],
220
+ sli_guid=foo["sliGuid"],
221
+ slo_target=foo_target,
222
+ slo_period=foo_period,
220
223
  is_bad_events=True)
221
- your_condition = newrelic.NrqlAlertCondition("yourCondition",
222
- account_id=12345678,
223
- policy_id=67890,
224
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
225
+ account_id="12345678",
226
+ policy_id="67890",
224
227
  type="static",
228
+ name="Slow burn alert",
225
229
  enabled=True,
226
230
  violation_time_limit_seconds=259200,
227
- nrql=newrelic.NrqlAlertConditionNrqlArgs(
228
- query=foo_slow_burn.nrql,
229
- ),
230
- critical=newrelic.NrqlAlertConditionCriticalArgs(
231
- operator="above_or_equals",
232
- threshold=foo_slow_burn.threshold,
233
- threshold_duration=900,
234
- threshold_occurrences="at_least_once",
235
- ),
231
+ nrql={
232
+ "query": foo_slow_burn.nrql,
233
+ },
234
+ critical={
235
+ "operator": "above_or_equals",
236
+ "threshold": foo_slow_burn.threshold,
237
+ "threshold_duration": 900,
238
+ "threshold_occurrences": "at_least_once",
239
+ },
236
240
  fill_option="none",
237
241
  aggregation_window=foo_slow_burn.evaluation_period,
238
242
  aggregation_method="event_flow",
239
243
  aggregation_delay="120",
240
244
  slide_by=900)
241
245
  ```
242
- <!--End PulumiCodeChooser -->
243
246
 
244
247
  Here is an example of a custom alert:
245
248
 
246
- <!--Start PulumiCodeChooser -->
247
249
  ```python
248
250
  import pulumi
249
251
  import pulumi_newrelic as newrelic
250
252
 
251
253
  foo_custom = newrelic.get_service_level_alert_helper(alert_type="custom",
252
- sli_guid=newrelic_service_level["foo"]["sli_guid"],
253
- slo_target=local["foo_target"],
254
- slo_period=local["foo_period"],
254
+ sli_guid=foo["sliGuid"],
255
+ slo_target=foo_target,
256
+ slo_period=foo_period,
255
257
  custom_tolerated_budget_consumption=4,
256
258
  custom_evaluation_period=5400,
257
259
  is_bad_events=True)
258
- your_condition = newrelic.NrqlAlertCondition("yourCondition",
259
- account_id=12345678,
260
- policy_id=67890,
260
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
261
+ account_id="12345678",
262
+ policy_id="67890",
261
263
  type="static",
264
+ name="Custom burn alert",
262
265
  enabled=True,
263
266
  violation_time_limit_seconds=259200,
264
- nrql=newrelic.NrqlAlertConditionNrqlArgs(
265
- query=foo_custom.nrql,
266
- ),
267
- critical=newrelic.NrqlAlertConditionCriticalArgs(
268
- operator="above_or_equals",
269
- threshold=foo_custom.threshold,
270
- threshold_duration=900,
271
- threshold_occurrences="at_least_once",
272
- ),
267
+ nrql={
268
+ "query": foo_custom.nrql,
269
+ },
270
+ critical={
271
+ "operator": "above_or_equals",
272
+ "threshold": foo_custom.threshold,
273
+ "threshold_duration": 900,
274
+ "threshold_occurrences": "at_least_once",
275
+ },
273
276
  fill_option="none",
274
277
  aggregation_window=foo_custom.evaluation_period,
275
278
  aggregation_method="event_flow",
276
279
  aggregation_delay="120",
277
280
  slide_by=60)
278
281
  ```
279
- <!--End PulumiCodeChooser -->
280
282
 
281
283
 
282
284
  :param str alert_type: The type of alert we want to set. Valid values are:
@@ -311,9 +313,6 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
311
313
  slo_target=pulumi.get(__ret__, 'slo_target'),
312
314
  threshold=pulumi.get(__ret__, 'threshold'),
313
315
  tolerated_budget_consumption=pulumi.get(__ret__, 'tolerated_budget_consumption'))
314
-
315
-
316
- @_utilities.lift_output_func(get_service_level_alert_helper)
317
316
  def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]] = None,
318
317
  custom_evaluation_period: Optional[pulumi.Input[Optional[int]]] = None,
319
318
  custom_tolerated_budget_consumption: Optional[pulumi.Input[Optional[float]]] = None,
@@ -321,7 +320,7 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
321
320
  sli_guid: Optional[pulumi.Input[str]] = None,
322
321
  slo_period: Optional[pulumi.Input[int]] = None,
323
322
  slo_target: Optional[pulumi.Input[float]] = None,
324
- opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetServiceLevelAlertHelperResult]:
323
+ opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetServiceLevelAlertHelperResult]:
325
324
  """
326
325
  Use this data source to obtain the necessary fields to set up alerts on your service levels. It can be used for a `custom` alert_type in order to set up an alert with custom tolerated budget consumption and custom evaluation period or for recommended ones like `fast_burn` or `slow_burn`. For more information check [the documentation](https://docs.newrelic.com/docs/service-level-management/alerts-slm/).
327
326
 
@@ -329,7 +328,6 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
329
328
 
330
329
  Firstly set up your service level objective, we recommend using local variables for the `target` and `time_window.rolling.count`, as they are also necessary for the helper.
331
330
 
332
- <!--Start PulumiCodeChooser -->
333
331
  ```python
334
332
  import pulumi
335
333
  import pulumi_newrelic as newrelic
@@ -338,104 +336,102 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
338
336
  foo_period = 28
339
337
  foo = newrelic.ServiceLevel("foo",
340
338
  guid="MXxBUE18QVBQTElDQVRJT058MQ",
339
+ name="Latency",
341
340
  description="Proportion of requests that are served faster than a threshold.",
342
- events=newrelic.ServiceLevelEventsArgs(
343
- account_id=12345678,
344
- valid_events=newrelic.ServiceLevelEventsValidEventsArgs(
345
- from_="Transaction",
346
- where="appName = 'Example application' AND (transactionType='Web')",
347
- ),
348
- bad_events=newrelic.ServiceLevelEventsBadEventsArgs(
349
- from_="Transaction",
350
- where="appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
351
- ),
352
- ),
353
- objective=newrelic.ServiceLevelObjectiveArgs(
354
- target=foo_target,
355
- time_window=newrelic.ServiceLevelObjectiveTimeWindowArgs(
356
- rolling=newrelic.ServiceLevelObjectiveTimeWindowRollingArgs(
357
- count=foo_period,
358
- unit="DAY",
359
- ),
360
- ),
361
- ))
341
+ events={
342
+ "account_id": "12345678",
343
+ "valid_events": {
344
+ "from_": "Transaction",
345
+ "where": "appName = 'Example application' AND (transactionType='Web')",
346
+ },
347
+ "bad_events": {
348
+ "from_": "Transaction",
349
+ "where": "appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
350
+ },
351
+ },
352
+ objective={
353
+ "target": foo_target,
354
+ "time_window": {
355
+ "rolling": {
356
+ "count": foo_period,
357
+ "unit": "DAY",
358
+ },
359
+ },
360
+ })
362
361
  ```
363
- <!--End PulumiCodeChooser -->
364
362
  Then use the helper to obtain the necessary fields to set up an alert on that Service Level.
365
363
  Note that the Service Level was set up using bad events, that's why `is_bad_events` is set to `true`.
366
364
  If the Service Level was configured with good events that would be unnecessary as the field defaults to `false`.
367
365
 
368
366
  Here is an example of a `slow_burn` alert.
369
367
 
370
- <!--Start PulumiCodeChooser -->
371
368
  ```python
372
369
  import pulumi
373
370
  import pulumi_newrelic as newrelic
374
371
 
375
372
  foo_slow_burn = newrelic.get_service_level_alert_helper(alert_type="slow_burn",
376
- sli_guid=newrelic_service_level["foo"]["sli_guid"],
377
- slo_target=local["foo_target"],
378
- slo_period=local["foo_period"],
373
+ sli_guid=foo["sliGuid"],
374
+ slo_target=foo_target,
375
+ slo_period=foo_period,
379
376
  is_bad_events=True)
380
- your_condition = newrelic.NrqlAlertCondition("yourCondition",
381
- account_id=12345678,
382
- policy_id=67890,
377
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
378
+ account_id="12345678",
379
+ policy_id="67890",
383
380
  type="static",
381
+ name="Slow burn alert",
384
382
  enabled=True,
385
383
  violation_time_limit_seconds=259200,
386
- nrql=newrelic.NrqlAlertConditionNrqlArgs(
387
- query=foo_slow_burn.nrql,
388
- ),
389
- critical=newrelic.NrqlAlertConditionCriticalArgs(
390
- operator="above_or_equals",
391
- threshold=foo_slow_burn.threshold,
392
- threshold_duration=900,
393
- threshold_occurrences="at_least_once",
394
- ),
384
+ nrql={
385
+ "query": foo_slow_burn.nrql,
386
+ },
387
+ critical={
388
+ "operator": "above_or_equals",
389
+ "threshold": foo_slow_burn.threshold,
390
+ "threshold_duration": 900,
391
+ "threshold_occurrences": "at_least_once",
392
+ },
395
393
  fill_option="none",
396
394
  aggregation_window=foo_slow_burn.evaluation_period,
397
395
  aggregation_method="event_flow",
398
396
  aggregation_delay="120",
399
397
  slide_by=900)
400
398
  ```
401
- <!--End PulumiCodeChooser -->
402
399
 
403
400
  Here is an example of a custom alert:
404
401
 
405
- <!--Start PulumiCodeChooser -->
406
402
  ```python
407
403
  import pulumi
408
404
  import pulumi_newrelic as newrelic
409
405
 
410
406
  foo_custom = newrelic.get_service_level_alert_helper(alert_type="custom",
411
- sli_guid=newrelic_service_level["foo"]["sli_guid"],
412
- slo_target=local["foo_target"],
413
- slo_period=local["foo_period"],
407
+ sli_guid=foo["sliGuid"],
408
+ slo_target=foo_target,
409
+ slo_period=foo_period,
414
410
  custom_tolerated_budget_consumption=4,
415
411
  custom_evaluation_period=5400,
416
412
  is_bad_events=True)
417
- your_condition = newrelic.NrqlAlertCondition("yourCondition",
418
- account_id=12345678,
419
- policy_id=67890,
413
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
414
+ account_id="12345678",
415
+ policy_id="67890",
420
416
  type="static",
417
+ name="Custom burn alert",
421
418
  enabled=True,
422
419
  violation_time_limit_seconds=259200,
423
- nrql=newrelic.NrqlAlertConditionNrqlArgs(
424
- query=foo_custom.nrql,
425
- ),
426
- critical=newrelic.NrqlAlertConditionCriticalArgs(
427
- operator="above_or_equals",
428
- threshold=foo_custom.threshold,
429
- threshold_duration=900,
430
- threshold_occurrences="at_least_once",
431
- ),
420
+ nrql={
421
+ "query": foo_custom.nrql,
422
+ },
423
+ critical={
424
+ "operator": "above_or_equals",
425
+ "threshold": foo_custom.threshold,
426
+ "threshold_duration": 900,
427
+ "threshold_occurrences": "at_least_once",
428
+ },
432
429
  fill_option="none",
433
430
  aggregation_window=foo_custom.evaluation_period,
434
431
  aggregation_method="event_flow",
435
432
  aggregation_delay="120",
436
433
  slide_by=60)
437
434
  ```
438
- <!--End PulumiCodeChooser -->
439
435
 
440
436
 
441
437
  :param str alert_type: The type of alert we want to set. Valid values are:
@@ -446,4 +442,26 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
446
442
  :param int slo_period: The time window of the Service Level Objective in days. Valid values are `1`, `7` and `28`.
447
443
  :param float slo_target: The target of the Service Level Objective, valid values between `0` and `100`.
448
444
  """
449
- ...
445
+ __args__ = dict()
446
+ __args__['alertType'] = alert_type
447
+ __args__['customEvaluationPeriod'] = custom_evaluation_period
448
+ __args__['customToleratedBudgetConsumption'] = custom_tolerated_budget_consumption
449
+ __args__['isBadEvents'] = is_bad_events
450
+ __args__['sliGuid'] = sli_guid
451
+ __args__['sloPeriod'] = slo_period
452
+ __args__['sloTarget'] = slo_target
453
+ opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
454
+ __ret__ = pulumi.runtime.invoke_output('newrelic:index/getServiceLevelAlertHelper:getServiceLevelAlertHelper', __args__, opts=opts, typ=GetServiceLevelAlertHelperResult)
455
+ return __ret__.apply(lambda __response__: GetServiceLevelAlertHelperResult(
456
+ alert_type=pulumi.get(__response__, 'alert_type'),
457
+ custom_evaluation_period=pulumi.get(__response__, 'custom_evaluation_period'),
458
+ custom_tolerated_budget_consumption=pulumi.get(__response__, 'custom_tolerated_budget_consumption'),
459
+ evaluation_period=pulumi.get(__response__, 'evaluation_period'),
460
+ id=pulumi.get(__response__, 'id'),
461
+ is_bad_events=pulumi.get(__response__, 'is_bad_events'),
462
+ nrql=pulumi.get(__response__, 'nrql'),
463
+ sli_guid=pulumi.get(__response__, 'sli_guid'),
464
+ slo_period=pulumi.get(__response__, 'slo_period'),
465
+ slo_target=pulumi.get(__response__, 'slo_target'),
466
+ threshold=pulumi.get(__response__, 'threshold'),
467
+ tolerated_budget_consumption=pulumi.get(__response__, 'tolerated_budget_consumption')))
@@ -4,9 +4,14 @@
4
4
 
5
5
  import copy
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
10
  from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
10
15
  from . import _utilities
11
16
  from . import outputs
12
17
 
@@ -23,8 +28,8 @@ class GetTestGrokPatternResult:
23
28
  A collection of values returned by getTestGrokPattern.
24
29
  """
25
30
  def __init__(__self__, account_id=None, grok=None, id=None, log_lines=None, test_groks=None):
26
- if account_id and not isinstance(account_id, int):
27
- raise TypeError("Expected argument 'account_id' to be a int")
31
+ if account_id and not isinstance(account_id, str):
32
+ raise TypeError("Expected argument 'account_id' to be a str")
28
33
  pulumi.set(__self__, "account_id", account_id)
29
34
  if grok and not isinstance(grok, str):
30
35
  raise TypeError("Expected argument 'grok' to be a str")
@@ -41,7 +46,7 @@ class GetTestGrokPatternResult:
41
46
 
42
47
  @property
43
48
  @pulumi.getter(name="accountId")
44
- def account_id(self) -> Optional[int]:
49
+ def account_id(self) -> Optional[str]:
45
50
  return pulumi.get(self, "account_id")
46
51
 
47
52
  @property
@@ -84,28 +89,27 @@ class AwaitableGetTestGrokPatternResult(GetTestGrokPatternResult):
84
89
  test_groks=self.test_groks)
85
90
 
86
91
 
87
- def get_test_grok_pattern(account_id: Optional[int] = None,
92
+ def get_test_grok_pattern(account_id: Optional[str] = None,
88
93
  grok: Optional[str] = None,
89
94
  log_lines: Optional[Sequence[str]] = None,
90
95
  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetTestGrokPatternResult:
91
96
  """
92
97
  ## Example Usage
93
98
 
94
- <!--Start PulumiCodeChooser -->
95
99
  ```python
96
100
  import pulumi
97
101
  import pulumi_newrelic as newrelic
98
102
 
99
- foo = newrelic.get_test_grok_pattern(grok="%%{IP:host_ip}",
103
+ # Data source
104
+ foo = newrelic.get_test_grok_pattern(grok="%{IP:host_ip}",
100
105
  log_lines=[
101
106
  "host_ip: 43.3.120.2",
102
107
  "bytes_received: 2048",
103
108
  ])
104
109
  ```
105
- <!--End PulumiCodeChooser -->
106
110
 
107
111
 
108
- :param int account_id: The New Relic account ID to operate on. This allows you to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
112
+ :param str account_id: The New Relic account ID to operate on. This allows you to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
109
113
  :param str grok: The Grok pattern to test.
110
114
  :param Sequence[str] log_lines: The log lines to test the Grok pattern against.
111
115
  """
@@ -122,32 +126,39 @@ def get_test_grok_pattern(account_id: Optional[int] = None,
122
126
  id=pulumi.get(__ret__, 'id'),
123
127
  log_lines=pulumi.get(__ret__, 'log_lines'),
124
128
  test_groks=pulumi.get(__ret__, 'test_groks'))
125
-
126
-
127
- @_utilities.lift_output_func(get_test_grok_pattern)
128
- def get_test_grok_pattern_output(account_id: Optional[pulumi.Input[Optional[int]]] = None,
129
+ def get_test_grok_pattern_output(account_id: Optional[pulumi.Input[Optional[str]]] = None,
129
130
  grok: Optional[pulumi.Input[str]] = None,
130
131
  log_lines: Optional[pulumi.Input[Sequence[str]]] = None,
131
- opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetTestGrokPatternResult]:
132
+ opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetTestGrokPatternResult]:
132
133
  """
133
134
  ## Example Usage
134
135
 
135
- <!--Start PulumiCodeChooser -->
136
136
  ```python
137
137
  import pulumi
138
138
  import pulumi_newrelic as newrelic
139
139
 
140
- foo = newrelic.get_test_grok_pattern(grok="%%{IP:host_ip}",
140
+ # Data source
141
+ foo = newrelic.get_test_grok_pattern(grok="%{IP:host_ip}",
141
142
  log_lines=[
142
143
  "host_ip: 43.3.120.2",
143
144
  "bytes_received: 2048",
144
145
  ])
145
146
  ```
146
- <!--End PulumiCodeChooser -->
147
147
 
148
148
 
149
- :param int account_id: The New Relic account ID to operate on. This allows you to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
149
+ :param str account_id: The New Relic account ID to operate on. This allows you to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
150
150
  :param str grok: The Grok pattern to test.
151
151
  :param Sequence[str] log_lines: The log lines to test the Grok pattern against.
152
152
  """
153
- ...
153
+ __args__ = dict()
154
+ __args__['accountId'] = account_id
155
+ __args__['grok'] = grok
156
+ __args__['logLines'] = log_lines
157
+ opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
158
+ __ret__ = pulumi.runtime.invoke_output('newrelic:index/getTestGrokPattern:getTestGrokPattern', __args__, opts=opts, typ=GetTestGrokPatternResult)
159
+ return __ret__.apply(lambda __response__: GetTestGrokPatternResult(
160
+ account_id=pulumi.get(__response__, 'account_id'),
161
+ grok=pulumi.get(__response__, 'grok'),
162
+ id=pulumi.get(__response__, 'id'),
163
+ log_lines=pulumi.get(__response__, 'log_lines'),
164
+ test_groks=pulumi.get(__response__, 'test_groks')))
@@ -4,9 +4,14 @@
4
4
 
5
5
  import copy
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
10
  from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
10
15
  from . import _utilities
11
16
 
12
17
  __all__ = [
@@ -81,7 +86,6 @@ def get_user(authentication_domain_id: Optional[str] = None,
81
86
  ## Example Usage
82
87
 
83
88
  The below example illustrates fetching a the ID of a user (and other arguments) using the ID of the authentication domain the user belongs to, as well as a name and/or email ID, which can be used as criteria to search for a user who matches these specified parameters.
84
- <!--Start PulumiCodeChooser -->
85
89
  ```python
86
90
  import pulumi
87
91
  import pulumi_newrelic as newrelic
@@ -92,7 +96,6 @@ def get_user(authentication_domain_id: Optional[str] = None,
92
96
  user_two = newrelic.get_user(authentication_domain_id=foo.id,
93
97
  email_id="test_user@random.com")
94
98
  ```
95
- <!--End PulumiCodeChooser -->
96
99
 
97
100
 
98
101
  :param str authentication_domain_id: The ID of the authentication domain the user to be searched for belongs to.
@@ -117,20 +120,16 @@ def get_user(authentication_domain_id: Optional[str] = None,
117
120
  email_id=pulumi.get(__ret__, 'email_id'),
118
121
  id=pulumi.get(__ret__, 'id'),
119
122
  name=pulumi.get(__ret__, 'name'))
120
-
121
-
122
- @_utilities.lift_output_func(get_user)
123
123
  def get_user_output(authentication_domain_id: Optional[pulumi.Input[str]] = None,
124
124
  email_id: Optional[pulumi.Input[Optional[str]]] = None,
125
125
  name: Optional[pulumi.Input[Optional[str]]] = None,
126
- opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetUserResult]:
126
+ opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetUserResult]:
127
127
  """
128
128
  The `User` data source helps search for a user by their name and/or email ID, and accordingly, fetch the ID of the matching user.
129
129
 
130
130
  ## Example Usage
131
131
 
132
132
  The below example illustrates fetching a the ID of a user (and other arguments) using the ID of the authentication domain the user belongs to, as well as a name and/or email ID, which can be used as criteria to search for a user who matches these specified parameters.
133
- <!--Start PulumiCodeChooser -->
134
133
  ```python
135
134
  import pulumi
136
135
  import pulumi_newrelic as newrelic
@@ -141,7 +140,6 @@ def get_user_output(authentication_domain_id: Optional[pulumi.Input[str]] = None
141
140
  user_two = newrelic.get_user(authentication_domain_id=foo.id,
142
141
  email_id="test_user@random.com")
143
142
  ```
144
- <!--End PulumiCodeChooser -->
145
143
 
146
144
 
147
145
  :param str authentication_domain_id: The ID of the authentication domain the user to be searched for belongs to.
@@ -154,4 +152,14 @@ def get_user_output(authentication_domain_id: Optional[pulumi.Input[str]] = None
154
152
  > **NOTE** The ID of an authentication domain can be retrieved using its name, via the data source `get_authentication_domain`, as shown in the example above. Head over to the documentation of this data source for more details and examples.
155
153
  :param str name: The name of the user to search for.
156
154
  """
157
- ...
155
+ __args__ = dict()
156
+ __args__['authenticationDomainId'] = authentication_domain_id
157
+ __args__['emailId'] = email_id
158
+ __args__['name'] = name
159
+ opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
160
+ __ret__ = pulumi.runtime.invoke_output('newrelic:index/getUser:getUser', __args__, opts=opts, typ=GetUserResult)
161
+ return __ret__.apply(lambda __response__: GetUserResult(
162
+ authentication_domain_id=pulumi.get(__response__, 'authentication_domain_id'),
163
+ email_id=pulumi.get(__response__, 'email_id'),
164
+ id=pulumi.get(__response__, 'id'),
165
+ name=pulumi.get(__response__, 'name')))