pulumi-newrelic 5.20.0a1709643785__py3-none-any.whl → 5.39.0a1736834464__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 +13 -4
  5. pulumi_newrelic/alert_channel.py +122 -101
  6. pulumi_newrelic/alert_condition.py +120 -109
  7. pulumi_newrelic/alert_muting_rule.py +130 -74
  8. pulumi_newrelic/alert_policy.py +88 -67
  9. pulumi_newrelic/alert_policy_channel.py +81 -68
  10. pulumi_newrelic/api_access_key.py +49 -52
  11. pulumi_newrelic/browser_application.py +79 -76
  12. pulumi_newrelic/cloud/_inputs.py +2527 -1082
  13. pulumi_newrelic/cloud/aws_govcloud_integrations.py +135 -130
  14. pulumi_newrelic/cloud/aws_govcloud_link_account.py +25 -18
  15. pulumi_newrelic/cloud/aws_integrations.py +300 -1324
  16. pulumi_newrelic/cloud/aws_link_account.py +25 -18
  17. pulumi_newrelic/cloud/azure_integrations.py +523 -481
  18. pulumi_newrelic/cloud/azure_link_account.py +36 -29
  19. pulumi_newrelic/cloud/gcp_integrations.py +343 -320
  20. pulumi_newrelic/cloud/gcp_link_account.py +25 -18
  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 +23 -16
  25. pulumi_newrelic/entity_tags.py +36 -31
  26. pulumi_newrelic/events_to_metrics_rule.py +27 -20
  27. pulumi_newrelic/get_account.py +24 -12
  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 -27
  31. pulumi_newrelic/get_authentication_domain.py +17 -9
  32. pulumi_newrelic/get_cloud_account.py +26 -14
  33. pulumi_newrelic/get_entity.py +90 -85
  34. pulumi_newrelic/get_group.py +58 -9
  35. pulumi_newrelic/get_key_transaction.py +109 -30
  36. pulumi_newrelic/get_notification_destination.py +64 -14
  37. pulumi_newrelic/get_obfuscation_expression.py +36 -24
  38. pulumi_newrelic/get_service_level_alert_helper.py +135 -105
  39. pulumi_newrelic/get_test_grok_pattern.py +29 -14
  40. pulumi_newrelic/get_user.py +17 -5
  41. pulumi_newrelic/group.py +5 -132
  42. pulumi_newrelic/infra_alert_condition.py +157 -140
  43. pulumi_newrelic/insights/_inputs.py +43 -0
  44. pulumi_newrelic/insights/event.py +50 -43
  45. pulumi_newrelic/insights/outputs.py +5 -0
  46. pulumi_newrelic/key_transaction.py +464 -0
  47. pulumi_newrelic/log_parsing_rule.py +29 -18
  48. pulumi_newrelic/monitor_downtime.py +215 -203
  49. pulumi_newrelic/notification_channel.py +387 -326
  50. pulumi_newrelic/notification_destination.py +248 -118
  51. pulumi_newrelic/nrql_alert_condition.py +353 -246
  52. pulumi_newrelic/nrql_drop_rule.py +57 -30
  53. pulumi_newrelic/obfuscation_expression.py +25 -18
  54. pulumi_newrelic/obfuscation_rule.py +40 -31
  55. pulumi_newrelic/one_dashboard.py +31 -26
  56. pulumi_newrelic/one_dashboard_json.py +21 -16
  57. pulumi_newrelic/one_dashboard_raw.py +112 -101
  58. pulumi_newrelic/outputs.py +2446 -245
  59. pulumi_newrelic/plugins/_inputs.py +145 -10
  60. pulumi_newrelic/plugins/application_settings.py +29 -20
  61. pulumi_newrelic/plugins/outputs.py +15 -10
  62. pulumi_newrelic/plugins/workload.py +285 -54
  63. pulumi_newrelic/provider.py +27 -33
  64. pulumi_newrelic/pulumi-plugin.json +2 -1
  65. pulumi_newrelic/service_level.py +193 -180
  66. pulumi_newrelic/synthetics/_inputs.py +159 -2
  67. pulumi_newrelic/synthetics/alert_condition.py +91 -78
  68. pulumi_newrelic/synthetics/broken_links_monitor.py +220 -93
  69. pulumi_newrelic/synthetics/cert_check_monitor.py +223 -94
  70. pulumi_newrelic/synthetics/get_private_location.py +34 -22
  71. pulumi_newrelic/synthetics/get_secure_credential.py +24 -12
  72. pulumi_newrelic/synthetics/monitor.py +352 -179
  73. pulumi_newrelic/synthetics/multi_location_alert_condition.py +109 -96
  74. pulumi_newrelic/synthetics/outputs.py +7 -2
  75. pulumi_newrelic/synthetics/private_location.py +27 -18
  76. pulumi_newrelic/synthetics/script_monitor.py +321 -168
  77. pulumi_newrelic/synthetics/secure_credential.py +25 -20
  78. pulumi_newrelic/synthetics/step_monitor.py +409 -98
  79. pulumi_newrelic/user.py +13 -6
  80. pulumi_newrelic/workflow.py +215 -184
  81. {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/METADATA +7 -6
  82. pulumi_newrelic-5.39.0a1736834464.dist-info/RECORD +90 -0
  83. {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/WHEEL +1 -1
  84. pulumi_newrelic-5.20.0a1709643785.dist-info/RECORD +0 -89
  85. {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.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
  from . import outputs
12
17
  from ._inputs import *
@@ -16,22 +21,22 @@ __all__ = ['WorkloadArgs', 'Workload']
16
21
  @pulumi.input_type
17
22
  class WorkloadArgs:
18
23
  def __init__(__self__, *,
19
- account_id: Optional[pulumi.Input[int]] = None,
24
+ account_id: Optional[pulumi.Input[str]] = None,
20
25
  description: Optional[pulumi.Input[str]] = None,
21
26
  entity_guids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
22
27
  entity_search_queries: Optional[pulumi.Input[Sequence[pulumi.Input['WorkloadEntitySearchQueryArgs']]]] = None,
23
28
  name: Optional[pulumi.Input[str]] = None,
24
- scope_account_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
29
+ scope_account_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
25
30
  status_config_automatic: Optional[pulumi.Input['WorkloadStatusConfigAutomaticArgs']] = None,
26
31
  status_config_static: Optional[pulumi.Input['WorkloadStatusConfigStaticArgs']] = None):
27
32
  """
28
33
  The set of arguments for constructing a Workload resource.
29
- :param pulumi.Input[int] account_id: The New Relic account ID where you want to create the workload.
34
+ :param pulumi.Input[str] account_id: The New Relic account ID where you want to create the workload.
30
35
  :param pulumi.Input[str] description: Relevant information about the workload.
31
36
  :param pulumi.Input[Sequence[pulumi.Input[str]]] entity_guids: A list of entity GUIDs manually assigned to this workload. At least one of either `entity_guids` or `entity_search_query` is required.
32
37
  :param pulumi.Input[Sequence[pulumi.Input['WorkloadEntitySearchQueryArgs']]] entity_search_queries: A list of search queries that define a dynamic workload. At least one of either `entity_guids` or `entity_search_query` is required. See Nested entity_search_query blocks below for details.
33
38
  :param pulumi.Input[str] name: The workload's name.
34
- :param pulumi.Input[Sequence[pulumi.Input[int]]] scope_account_ids: A list of account IDs that will be used to get entities from.
39
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] scope_account_ids: A list of account IDs that will be used to get entities from.
35
40
  :param pulumi.Input['WorkloadStatusConfigAutomaticArgs'] status_config_automatic: An input object used to represent an automatic status configuration.See Nested status_config_automatic blocks below for details.
36
41
  :param pulumi.Input['WorkloadStatusConfigStaticArgs'] status_config_static: A list of static status configurations. You can only configure one static status for a workload.See Nested status_config_static blocks below for details.
37
42
  """
@@ -54,14 +59,14 @@ class WorkloadArgs:
54
59
 
55
60
  @property
56
61
  @pulumi.getter(name="accountId")
57
- def account_id(self) -> Optional[pulumi.Input[int]]:
62
+ def account_id(self) -> Optional[pulumi.Input[str]]:
58
63
  """
59
64
  The New Relic account ID where you want to create the workload.
60
65
  """
61
66
  return pulumi.get(self, "account_id")
62
67
 
63
68
  @account_id.setter
64
- def account_id(self, value: Optional[pulumi.Input[int]]):
69
+ def account_id(self, value: Optional[pulumi.Input[str]]):
65
70
  pulumi.set(self, "account_id", value)
66
71
 
67
72
  @property
@@ -114,14 +119,14 @@ class WorkloadArgs:
114
119
 
115
120
  @property
116
121
  @pulumi.getter(name="scopeAccountIds")
117
- def scope_account_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]:
122
+ def scope_account_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
118
123
  """
119
124
  A list of account IDs that will be used to get entities from.
120
125
  """
121
126
  return pulumi.get(self, "scope_account_ids")
122
127
 
123
128
  @scope_account_ids.setter
124
- def scope_account_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]):
129
+ def scope_account_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
125
130
  pulumi.set(self, "scope_account_ids", value)
126
131
 
127
132
  @property
@@ -152,7 +157,7 @@ class WorkloadArgs:
152
157
  @pulumi.input_type
153
158
  class _WorkloadState:
154
159
  def __init__(__self__, *,
155
- account_id: Optional[pulumi.Input[int]] = None,
160
+ account_id: Optional[pulumi.Input[str]] = None,
156
161
  composite_entity_search_query: Optional[pulumi.Input[str]] = None,
157
162
  description: Optional[pulumi.Input[str]] = None,
158
163
  entity_guids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
@@ -160,13 +165,13 @@ class _WorkloadState:
160
165
  guid: Optional[pulumi.Input[str]] = None,
161
166
  name: Optional[pulumi.Input[str]] = None,
162
167
  permalink: Optional[pulumi.Input[str]] = None,
163
- scope_account_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
168
+ scope_account_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
164
169
  status_config_automatic: Optional[pulumi.Input['WorkloadStatusConfigAutomaticArgs']] = None,
165
170
  status_config_static: Optional[pulumi.Input['WorkloadStatusConfigStaticArgs']] = None,
166
- workload_id: Optional[pulumi.Input[int]] = None):
171
+ workload_id: Optional[pulumi.Input[str]] = None):
167
172
  """
168
173
  Input properties used for looking up and filtering Workload resources.
169
- :param pulumi.Input[int] account_id: The New Relic account ID where you want to create the workload.
174
+ :param pulumi.Input[str] account_id: The New Relic account ID where you want to create the workload.
170
175
  :param pulumi.Input[str] composite_entity_search_query: The composite query used to compose a dynamic workload.
171
176
  :param pulumi.Input[str] description: Relevant information about the workload.
172
177
  :param pulumi.Input[Sequence[pulumi.Input[str]]] entity_guids: A list of entity GUIDs manually assigned to this workload. At least one of either `entity_guids` or `entity_search_query` is required.
@@ -174,10 +179,10 @@ class _WorkloadState:
174
179
  :param pulumi.Input[str] guid: The unique entity identifier of the workload in New Relic.
175
180
  :param pulumi.Input[str] name: The workload's name.
176
181
  :param pulumi.Input[str] permalink: The URL of the workload.
177
- :param pulumi.Input[Sequence[pulumi.Input[int]]] scope_account_ids: A list of account IDs that will be used to get entities from.
182
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] scope_account_ids: A list of account IDs that will be used to get entities from.
178
183
  :param pulumi.Input['WorkloadStatusConfigAutomaticArgs'] status_config_automatic: An input object used to represent an automatic status configuration.See Nested status_config_automatic blocks below for details.
179
184
  :param pulumi.Input['WorkloadStatusConfigStaticArgs'] status_config_static: A list of static status configurations. You can only configure one static status for a workload.See Nested status_config_static blocks below for details.
180
- :param pulumi.Input[int] workload_id: The unique entity identifier of the workload.
185
+ :param pulumi.Input[str] workload_id: The unique entity identifier of the workload.
181
186
  """
182
187
  if account_id is not None:
183
188
  pulumi.set(__self__, "account_id", account_id)
@@ -206,14 +211,14 @@ class _WorkloadState:
206
211
 
207
212
  @property
208
213
  @pulumi.getter(name="accountId")
209
- def account_id(self) -> Optional[pulumi.Input[int]]:
214
+ def account_id(self) -> Optional[pulumi.Input[str]]:
210
215
  """
211
216
  The New Relic account ID where you want to create the workload.
212
217
  """
213
218
  return pulumi.get(self, "account_id")
214
219
 
215
220
  @account_id.setter
216
- def account_id(self, value: Optional[pulumi.Input[int]]):
221
+ def account_id(self, value: Optional[pulumi.Input[str]]):
217
222
  pulumi.set(self, "account_id", value)
218
223
 
219
224
  @property
@@ -302,14 +307,14 @@ class _WorkloadState:
302
307
 
303
308
  @property
304
309
  @pulumi.getter(name="scopeAccountIds")
305
- def scope_account_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]:
310
+ def scope_account_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
306
311
  """
307
312
  A list of account IDs that will be used to get entities from.
308
313
  """
309
314
  return pulumi.get(self, "scope_account_ids")
310
315
 
311
316
  @scope_account_ids.setter
312
- def scope_account_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]):
317
+ def scope_account_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
313
318
  pulumi.set(self, "scope_account_ids", value)
314
319
 
315
320
  @property
@@ -338,14 +343,14 @@ class _WorkloadState:
338
343
 
339
344
  @property
340
345
  @pulumi.getter(name="workloadId")
341
- def workload_id(self) -> Optional[pulumi.Input[int]]:
346
+ def workload_id(self) -> Optional[pulumi.Input[str]]:
342
347
  """
343
348
  The unique entity identifier of the workload.
344
349
  """
345
350
  return pulumi.get(self, "workload_id")
346
351
 
347
352
  @workload_id.setter
348
- def workload_id(self, value: Optional[pulumi.Input[int]]):
353
+ def workload_id(self, value: Optional[pulumi.Input[str]]):
349
354
  pulumi.set(self, "workload_id", value)
350
355
 
351
356
 
@@ -354,14 +359,14 @@ class Workload(pulumi.CustomResource):
354
359
  def __init__(__self__,
355
360
  resource_name: str,
356
361
  opts: Optional[pulumi.ResourceOptions] = None,
357
- account_id: Optional[pulumi.Input[int]] = None,
362
+ account_id: Optional[pulumi.Input[str]] = None,
358
363
  description: Optional[pulumi.Input[str]] = None,
359
364
  entity_guids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
360
- entity_search_queries: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkloadEntitySearchQueryArgs']]]]] = None,
365
+ entity_search_queries: Optional[pulumi.Input[Sequence[pulumi.Input[Union['WorkloadEntitySearchQueryArgs', 'WorkloadEntitySearchQueryArgsDict']]]]] = None,
361
366
  name: Optional[pulumi.Input[str]] = None,
362
- scope_account_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
363
- status_config_automatic: Optional[pulumi.Input[pulumi.InputType['WorkloadStatusConfigAutomaticArgs']]] = None,
364
- status_config_static: Optional[pulumi.Input[pulumi.InputType['WorkloadStatusConfigStaticArgs']]] = None,
367
+ scope_account_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
368
+ status_config_automatic: Optional[pulumi.Input[Union['WorkloadStatusConfigAutomaticArgs', 'WorkloadStatusConfigAutomaticArgsDict']]] = None,
369
+ status_config_static: Optional[pulumi.Input[Union['WorkloadStatusConfigStaticArgs', 'WorkloadStatusConfigStaticArgsDict']]] = None,
365
370
  __props__=None):
366
371
  """
367
372
  Use this resource to create, update, and delete a New Relic One workload.
@@ -370,13 +375,126 @@ class Workload(pulumi.CustomResource):
370
375
  attribute in the `provider` block or the `NEW_RELIC_API_KEY` environment
371
376
  variable with your User API key.
372
377
 
378
+ ## Example Usage
379
+
380
+ Include entities with a certain string on the name.
381
+ ```python
382
+ import pulumi
383
+ import pulumi_newrelic as newrelic
384
+
385
+ foo = newrelic.plugins.Workload("foo",
386
+ name="Example workload",
387
+ account_id="12345678",
388
+ entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
389
+ entity_search_queries=[{
390
+ "query": "name like '%Example application%'",
391
+ }],
392
+ scope_account_ids=["12345678"])
393
+ ```
394
+
395
+ Include entities with a set of tags.
396
+ ```python
397
+ import pulumi
398
+ import pulumi_newrelic as newrelic
399
+
400
+ foo = newrelic.plugins.Workload("foo",
401
+ name="Example workload with tags",
402
+ account_id="12345678",
403
+ entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
404
+ entity_search_queries=[{
405
+ "query": "tags.accountId = '12345678' AND tags.environment='production' AND tags.language='java'",
406
+ }],
407
+ scope_account_ids=["12345678"])
408
+ ```
409
+
410
+ Include entities with a set of tags.
411
+ ```python
412
+ import pulumi
413
+ import pulumi_newrelic as newrelic
414
+
415
+ foo = newrelic.plugins.Workload("foo",
416
+ name="Example workload with tags",
417
+ account_id="12345678",
418
+ entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
419
+ entity_search_queries=[{
420
+ "query": "tags.accountId = '12345678' AND tags.environment='production' AND tags.language='java'",
421
+ }],
422
+ scope_account_ids=["12345678"])
423
+ ```
424
+
425
+ Include automatic status
426
+
427
+ > The global status of your workload is a quick indicator of the workload health. You can configure it to be calculated automatically, and you can also set an alert and get a notification whenever the workload stops being operational. Alternatively, you can communicate a certain status of the workload by setting up a static value and a description. [See our docs](https://docs.newrelic.com/docs/workloads/use-workloads/workloads/workload-status)
428
+
429
+ ```python
430
+ import pulumi
431
+ import pulumi_newrelic as newrelic
432
+
433
+ foo = newrelic.plugins.Workload("foo",
434
+ name="Example workload",
435
+ account_id="12345678",
436
+ entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
437
+ entity_search_queries=[{
438
+ "query": "name like '%Example application%'",
439
+ }],
440
+ scope_account_ids=["12345678"],
441
+ description="Description",
442
+ status_config_automatic={
443
+ "enabled": True,
444
+ "remaining_entities_rule": {
445
+ "remaining_entities_rule_rollup": {
446
+ "strategy": "BEST_STATUS_WINS",
447
+ "threshold_type": "FIXED",
448
+ "threshold_value": 100,
449
+ "group_by": "ENTITY_TYPE",
450
+ },
451
+ },
452
+ "rules": [{
453
+ "entity_guids": ["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
454
+ "nrql_queries": [{
455
+ "query": "name like '%Example application2%'",
456
+ }],
457
+ "rollup": {
458
+ "strategy": "BEST_STATUS_WINS",
459
+ "threshold_type": "FIXED",
460
+ "threshold_value": 100,
461
+ },
462
+ }],
463
+ })
464
+ ```
465
+
466
+ Include static status
467
+
468
+ > You can use this during maintenance tasks or any other time you want to provide a fixed status for your workload. This overrides all automatic rules. [See our docs](https://docs.newrelic.com/docs/workloads/use-workloads/workloads/workload-status#configure-static)
469
+
470
+ ```python
471
+ import pulumi
472
+ import pulumi_newrelic as newrelic
473
+
474
+ foo = newrelic.plugins.Workload("foo",
475
+ name="Example workload",
476
+ account_id="12345678",
477
+ entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
478
+ entity_search_queries=[{
479
+ "query": "name like '%Example application%'",
480
+ }],
481
+ scope_account_ids=["12345678"],
482
+ description="Description",
483
+ status_config_static={
484
+ "description": "test",
485
+ "enabled": True,
486
+ "status": "OPERATIONAL",
487
+ "summary": "summary of the status",
488
+ })
489
+ ```
490
+
373
491
  ## Import
374
492
 
375
493
  New Relic workloads can be imported using a concatenated string of the format
376
494
 
377
- `<account_id>:<workload_id>:<guid>`, e.g.
495
+ `<account_id>:<workload_id>:<guid>`, e.g.
378
496
 
379
- bash
497
+ bash
380
498
 
381
499
  ```sh
382
500
  $ pulumi import newrelic:plugins/workload:Workload foo 12345678:1456:MjUyMDUyOHxBUE18QVBRTElDQVRJT058MjE1MDM3Nzk1
@@ -384,14 +502,14 @@ class Workload(pulumi.CustomResource):
384
502
 
385
503
  :param str resource_name: The name of the resource.
386
504
  :param pulumi.ResourceOptions opts: Options for the resource.
387
- :param pulumi.Input[int] account_id: The New Relic account ID where you want to create the workload.
505
+ :param pulumi.Input[str] account_id: The New Relic account ID where you want to create the workload.
388
506
  :param pulumi.Input[str] description: Relevant information about the workload.
389
507
  :param pulumi.Input[Sequence[pulumi.Input[str]]] entity_guids: A list of entity GUIDs manually assigned to this workload. At least one of either `entity_guids` or `entity_search_query` is required.
390
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkloadEntitySearchQueryArgs']]]] entity_search_queries: A list of search queries that define a dynamic workload. At least one of either `entity_guids` or `entity_search_query` is required. See Nested entity_search_query blocks below for details.
508
+ :param pulumi.Input[Sequence[pulumi.Input[Union['WorkloadEntitySearchQueryArgs', 'WorkloadEntitySearchQueryArgsDict']]]] entity_search_queries: A list of search queries that define a dynamic workload. At least one of either `entity_guids` or `entity_search_query` is required. See Nested entity_search_query blocks below for details.
391
509
  :param pulumi.Input[str] name: The workload's name.
392
- :param pulumi.Input[Sequence[pulumi.Input[int]]] scope_account_ids: A list of account IDs that will be used to get entities from.
393
- :param pulumi.Input[pulumi.InputType['WorkloadStatusConfigAutomaticArgs']] status_config_automatic: An input object used to represent an automatic status configuration.See Nested status_config_automatic blocks below for details.
394
- :param pulumi.Input[pulumi.InputType['WorkloadStatusConfigStaticArgs']] status_config_static: A list of static status configurations. You can only configure one static status for a workload.See Nested status_config_static blocks below for details.
510
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] scope_account_ids: A list of account IDs that will be used to get entities from.
511
+ :param pulumi.Input[Union['WorkloadStatusConfigAutomaticArgs', 'WorkloadStatusConfigAutomaticArgsDict']] status_config_automatic: An input object used to represent an automatic status configuration.See Nested status_config_automatic blocks below for details.
512
+ :param pulumi.Input[Union['WorkloadStatusConfigStaticArgs', 'WorkloadStatusConfigStaticArgsDict']] status_config_static: A list of static status configurations. You can only configure one static status for a workload.See Nested status_config_static blocks below for details.
395
513
  """
396
514
  ...
397
515
  @overload
@@ -406,13 +524,126 @@ class Workload(pulumi.CustomResource):
406
524
  attribute in the `provider` block or the `NEW_RELIC_API_KEY` environment
407
525
  variable with your User API key.
408
526
 
527
+ ## Example Usage
528
+
529
+ Include entities with a certain string on the name.
530
+ ```python
531
+ import pulumi
532
+ import pulumi_newrelic as newrelic
533
+
534
+ foo = newrelic.plugins.Workload("foo",
535
+ name="Example workload",
536
+ account_id="12345678",
537
+ entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
538
+ entity_search_queries=[{
539
+ "query": "name like '%Example application%'",
540
+ }],
541
+ scope_account_ids=["12345678"])
542
+ ```
543
+
544
+ Include entities with a set of tags.
545
+ ```python
546
+ import pulumi
547
+ import pulumi_newrelic as newrelic
548
+
549
+ foo = newrelic.plugins.Workload("foo",
550
+ name="Example workload with tags",
551
+ account_id="12345678",
552
+ entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
553
+ entity_search_queries=[{
554
+ "query": "tags.accountId = '12345678' AND tags.environment='production' AND tags.language='java'",
555
+ }],
556
+ scope_account_ids=["12345678"])
557
+ ```
558
+
559
+ Include entities with a set of tags.
560
+ ```python
561
+ import pulumi
562
+ import pulumi_newrelic as newrelic
563
+
564
+ foo = newrelic.plugins.Workload("foo",
565
+ name="Example workload with tags",
566
+ account_id="12345678",
567
+ entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
568
+ entity_search_queries=[{
569
+ "query": "tags.accountId = '12345678' AND tags.environment='production' AND tags.language='java'",
570
+ }],
571
+ scope_account_ids=["12345678"])
572
+ ```
573
+
574
+ Include automatic status
575
+
576
+ > The global status of your workload is a quick indicator of the workload health. You can configure it to be calculated automatically, and you can also set an alert and get a notification whenever the workload stops being operational. Alternatively, you can communicate a certain status of the workload by setting up a static value and a description. [See our docs](https://docs.newrelic.com/docs/workloads/use-workloads/workloads/workload-status)
577
+
578
+ ```python
579
+ import pulumi
580
+ import pulumi_newrelic as newrelic
581
+
582
+ foo = newrelic.plugins.Workload("foo",
583
+ name="Example workload",
584
+ account_id="12345678",
585
+ entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
586
+ entity_search_queries=[{
587
+ "query": "name like '%Example application%'",
588
+ }],
589
+ scope_account_ids=["12345678"],
590
+ description="Description",
591
+ status_config_automatic={
592
+ "enabled": True,
593
+ "remaining_entities_rule": {
594
+ "remaining_entities_rule_rollup": {
595
+ "strategy": "BEST_STATUS_WINS",
596
+ "threshold_type": "FIXED",
597
+ "threshold_value": 100,
598
+ "group_by": "ENTITY_TYPE",
599
+ },
600
+ },
601
+ "rules": [{
602
+ "entity_guids": ["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
603
+ "nrql_queries": [{
604
+ "query": "name like '%Example application2%'",
605
+ }],
606
+ "rollup": {
607
+ "strategy": "BEST_STATUS_WINS",
608
+ "threshold_type": "FIXED",
609
+ "threshold_value": 100,
610
+ },
611
+ }],
612
+ })
613
+ ```
614
+
615
+ Include static status
616
+
617
+ > You can use this during maintenance tasks or any other time you want to provide a fixed status for your workload. This overrides all automatic rules. [See our docs](https://docs.newrelic.com/docs/workloads/use-workloads/workloads/workload-status#configure-static)
618
+
619
+ ```python
620
+ import pulumi
621
+ import pulumi_newrelic as newrelic
622
+
623
+ foo = newrelic.plugins.Workload("foo",
624
+ name="Example workload",
625
+ account_id="12345678",
626
+ entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
627
+ entity_search_queries=[{
628
+ "query": "name like '%Example application%'",
629
+ }],
630
+ scope_account_ids=["12345678"],
631
+ description="Description",
632
+ status_config_static={
633
+ "description": "test",
634
+ "enabled": True,
635
+ "status": "OPERATIONAL",
636
+ "summary": "summary of the status",
637
+ })
638
+ ```
639
+
409
640
  ## Import
410
641
 
411
642
  New Relic workloads can be imported using a concatenated string of the format
412
643
 
413
- `<account_id>:<workload_id>:<guid>`, e.g.
644
+ `<account_id>:<workload_id>:<guid>`, e.g.
414
645
 
415
- bash
646
+ bash
416
647
 
417
648
  ```sh
418
649
  $ pulumi import newrelic:plugins/workload:Workload foo 12345678:1456:MjUyMDUyOHxBUE18QVBRTElDQVRJT058MjE1MDM3Nzk1
@@ -433,14 +664,14 @@ class Workload(pulumi.CustomResource):
433
664
  def _internal_init(__self__,
434
665
  resource_name: str,
435
666
  opts: Optional[pulumi.ResourceOptions] = None,
436
- account_id: Optional[pulumi.Input[int]] = None,
667
+ account_id: Optional[pulumi.Input[str]] = None,
437
668
  description: Optional[pulumi.Input[str]] = None,
438
669
  entity_guids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
439
- entity_search_queries: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkloadEntitySearchQueryArgs']]]]] = None,
670
+ entity_search_queries: Optional[pulumi.Input[Sequence[pulumi.Input[Union['WorkloadEntitySearchQueryArgs', 'WorkloadEntitySearchQueryArgsDict']]]]] = None,
440
671
  name: Optional[pulumi.Input[str]] = None,
441
- scope_account_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
442
- status_config_automatic: Optional[pulumi.Input[pulumi.InputType['WorkloadStatusConfigAutomaticArgs']]] = None,
443
- status_config_static: Optional[pulumi.Input[pulumi.InputType['WorkloadStatusConfigStaticArgs']]] = None,
672
+ scope_account_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
673
+ status_config_automatic: Optional[pulumi.Input[Union['WorkloadStatusConfigAutomaticArgs', 'WorkloadStatusConfigAutomaticArgsDict']]] = None,
674
+ status_config_static: Optional[pulumi.Input[Union['WorkloadStatusConfigStaticArgs', 'WorkloadStatusConfigStaticArgsDict']]] = None,
444
675
  __props__=None):
445
676
  opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
446
677
  if not isinstance(opts, pulumi.ResourceOptions):
@@ -472,18 +703,18 @@ class Workload(pulumi.CustomResource):
472
703
  def get(resource_name: str,
473
704
  id: pulumi.Input[str],
474
705
  opts: Optional[pulumi.ResourceOptions] = None,
475
- account_id: Optional[pulumi.Input[int]] = None,
706
+ account_id: Optional[pulumi.Input[str]] = None,
476
707
  composite_entity_search_query: Optional[pulumi.Input[str]] = None,
477
708
  description: Optional[pulumi.Input[str]] = None,
478
709
  entity_guids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
479
- entity_search_queries: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkloadEntitySearchQueryArgs']]]]] = None,
710
+ entity_search_queries: Optional[pulumi.Input[Sequence[pulumi.Input[Union['WorkloadEntitySearchQueryArgs', 'WorkloadEntitySearchQueryArgsDict']]]]] = None,
480
711
  guid: Optional[pulumi.Input[str]] = None,
481
712
  name: Optional[pulumi.Input[str]] = None,
482
713
  permalink: Optional[pulumi.Input[str]] = None,
483
- scope_account_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
484
- status_config_automatic: Optional[pulumi.Input[pulumi.InputType['WorkloadStatusConfigAutomaticArgs']]] = None,
485
- status_config_static: Optional[pulumi.Input[pulumi.InputType['WorkloadStatusConfigStaticArgs']]] = None,
486
- workload_id: Optional[pulumi.Input[int]] = None) -> 'Workload':
714
+ scope_account_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
715
+ status_config_automatic: Optional[pulumi.Input[Union['WorkloadStatusConfigAutomaticArgs', 'WorkloadStatusConfigAutomaticArgsDict']]] = None,
716
+ status_config_static: Optional[pulumi.Input[Union['WorkloadStatusConfigStaticArgs', 'WorkloadStatusConfigStaticArgsDict']]] = None,
717
+ workload_id: Optional[pulumi.Input[str]] = None) -> 'Workload':
487
718
  """
488
719
  Get an existing Workload resource's state with the given name, id, and optional extra
489
720
  properties used to qualify the lookup.
@@ -491,18 +722,18 @@ class Workload(pulumi.CustomResource):
491
722
  :param str resource_name: The unique name of the resulting resource.
492
723
  :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
493
724
  :param pulumi.ResourceOptions opts: Options for the resource.
494
- :param pulumi.Input[int] account_id: The New Relic account ID where you want to create the workload.
725
+ :param pulumi.Input[str] account_id: The New Relic account ID where you want to create the workload.
495
726
  :param pulumi.Input[str] composite_entity_search_query: The composite query used to compose a dynamic workload.
496
727
  :param pulumi.Input[str] description: Relevant information about the workload.
497
728
  :param pulumi.Input[Sequence[pulumi.Input[str]]] entity_guids: A list of entity GUIDs manually assigned to this workload. At least one of either `entity_guids` or `entity_search_query` is required.
498
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkloadEntitySearchQueryArgs']]]] entity_search_queries: A list of search queries that define a dynamic workload. At least one of either `entity_guids` or `entity_search_query` is required. See Nested entity_search_query blocks below for details.
729
+ :param pulumi.Input[Sequence[pulumi.Input[Union['WorkloadEntitySearchQueryArgs', 'WorkloadEntitySearchQueryArgsDict']]]] entity_search_queries: A list of search queries that define a dynamic workload. At least one of either `entity_guids` or `entity_search_query` is required. See Nested entity_search_query blocks below for details.
499
730
  :param pulumi.Input[str] guid: The unique entity identifier of the workload in New Relic.
500
731
  :param pulumi.Input[str] name: The workload's name.
501
732
  :param pulumi.Input[str] permalink: The URL of the workload.
502
- :param pulumi.Input[Sequence[pulumi.Input[int]]] scope_account_ids: A list of account IDs that will be used to get entities from.
503
- :param pulumi.Input[pulumi.InputType['WorkloadStatusConfigAutomaticArgs']] status_config_automatic: An input object used to represent an automatic status configuration.See Nested status_config_automatic blocks below for details.
504
- :param pulumi.Input[pulumi.InputType['WorkloadStatusConfigStaticArgs']] status_config_static: A list of static status configurations. You can only configure one static status for a workload.See Nested status_config_static blocks below for details.
505
- :param pulumi.Input[int] workload_id: The unique entity identifier of the workload.
733
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] scope_account_ids: A list of account IDs that will be used to get entities from.
734
+ :param pulumi.Input[Union['WorkloadStatusConfigAutomaticArgs', 'WorkloadStatusConfigAutomaticArgsDict']] status_config_automatic: An input object used to represent an automatic status configuration.See Nested status_config_automatic blocks below for details.
735
+ :param pulumi.Input[Union['WorkloadStatusConfigStaticArgs', 'WorkloadStatusConfigStaticArgsDict']] status_config_static: A list of static status configurations. You can only configure one static status for a workload.See Nested status_config_static blocks below for details.
736
+ :param pulumi.Input[str] workload_id: The unique entity identifier of the workload.
506
737
  """
507
738
  opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
508
739
 
@@ -524,7 +755,7 @@ class Workload(pulumi.CustomResource):
524
755
 
525
756
  @property
526
757
  @pulumi.getter(name="accountId")
527
- def account_id(self) -> pulumi.Output[int]:
758
+ def account_id(self) -> pulumi.Output[str]:
528
759
  """
529
760
  The New Relic account ID where you want to create the workload.
530
761
  """
@@ -588,7 +819,7 @@ class Workload(pulumi.CustomResource):
588
819
 
589
820
  @property
590
821
  @pulumi.getter(name="scopeAccountIds")
591
- def scope_account_ids(self) -> pulumi.Output[Sequence[int]]:
822
+ def scope_account_ids(self) -> pulumi.Output[Sequence[str]]:
592
823
  """
593
824
  A list of account IDs that will be used to get entities from.
594
825
  """
@@ -612,7 +843,7 @@ class Workload(pulumi.CustomResource):
612
843
 
613
844
  @property
614
845
  @pulumi.getter(name="workloadId")
615
- def workload_id(self) -> pulumi.Output[int]:
846
+ def workload_id(self) -> pulumi.Output[str]:
616
847
  """
617
848
  The unique entity identifier of the workload.
618
849
  """