pulumi-newrelic 5.16.0a1698964311__py3-none-any.whl → 5.58.0a1763707205__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.

Potentially problematic release.


This version of pulumi-newrelic might be problematic. Click here for more details.

Files changed (92) hide show
  1. pulumi_newrelic/__init__.py +58 -1
  2. pulumi_newrelic/_inputs.py +10772 -2775
  3. pulumi_newrelic/_utilities.py +92 -11
  4. pulumi_newrelic/account_management.py +56 -42
  5. pulumi_newrelic/alert_channel.py +177 -151
  6. pulumi_newrelic/alert_condition.py +313 -301
  7. pulumi_newrelic/alert_muting_rule.py +195 -138
  8. pulumi_newrelic/alert_policy.py +157 -109
  9. pulumi_newrelic/alert_policy_channel.py +95 -81
  10. pulumi_newrelic/api_access_key.py +191 -209
  11. pulumi_newrelic/browser_application.py +161 -153
  12. pulumi_newrelic/cloud/__init__.py +3 -1
  13. pulumi_newrelic/cloud/_inputs.py +4267 -2710
  14. pulumi_newrelic/cloud/aws_govcloud_integrations.py +238 -200
  15. pulumi_newrelic/cloud/aws_govcloud_link_account.py +159 -212
  16. pulumi_newrelic/cloud/aws_integrations.py +518 -1490
  17. pulumi_newrelic/cloud/aws_link_account.py +88 -76
  18. pulumi_newrelic/cloud/azure_integrations.py +681 -587
  19. pulumi_newrelic/cloud/azure_link_account.py +129 -117
  20. pulumi_newrelic/cloud/gcp_integrations.py +436 -408
  21. pulumi_newrelic/cloud/gcp_link_account.py +71 -59
  22. pulumi_newrelic/cloud/oci_link_account.py +926 -0
  23. pulumi_newrelic/cloud/outputs.py +1678 -2317
  24. pulumi_newrelic/config/__init__.py +2 -1
  25. pulumi_newrelic/config/__init__.pyi +45 -0
  26. pulumi_newrelic/config/vars.py +22 -17
  27. pulumi_newrelic/data_partition_rule.py +129 -117
  28. pulumi_newrelic/entity_tags.py +153 -31
  29. pulumi_newrelic/events_to_metrics_rule.py +114 -102
  30. pulumi_newrelic/get_account.py +41 -29
  31. pulumi_newrelic/get_alert_channel.py +73 -28
  32. pulumi_newrelic/get_alert_policy.py +83 -34
  33. pulumi_newrelic/get_application.py +51 -39
  34. pulumi_newrelic/get_authentication_domain.py +111 -0
  35. pulumi_newrelic/get_cloud_account.py +43 -31
  36. pulumi_newrelic/get_entity.py +126 -121
  37. pulumi_newrelic/get_group.py +190 -0
  38. pulumi_newrelic/get_key_transaction.py +117 -38
  39. pulumi_newrelic/get_notification_destination.py +86 -36
  40. pulumi_newrelic/get_obfuscation_expression.py +47 -35
  41. pulumi_newrelic/get_service_level_alert_helper.py +237 -137
  42. pulumi_newrelic/get_test_grok_pattern.py +47 -32
  43. pulumi_newrelic/get_user.py +165 -0
  44. pulumi_newrelic/group.py +286 -0
  45. pulumi_newrelic/infra_alert_condition.py +400 -382
  46. pulumi_newrelic/insights/__init__.py +2 -1
  47. pulumi_newrelic/insights/_inputs.py +94 -23
  48. pulumi_newrelic/insights/event.py +56 -48
  49. pulumi_newrelic/insights/outputs.py +51 -18
  50. pulumi_newrelic/key_transaction.py +465 -0
  51. pulumi_newrelic/log_parsing_rule.py +169 -153
  52. pulumi_newrelic/monitor_downtime.py +914 -0
  53. pulumi_newrelic/notification_channel.py +560 -418
  54. pulumi_newrelic/notification_destination.py +379 -124
  55. pulumi_newrelic/nrql_alert_condition.py +945 -513
  56. pulumi_newrelic/nrql_drop_rule.py +121 -129
  57. pulumi_newrelic/obfuscation_expression.py +88 -76
  58. pulumi_newrelic/obfuscation_rule.py +123 -109
  59. pulumi_newrelic/one_dashboard.py +118 -108
  60. pulumi_newrelic/one_dashboard_json.py +77 -67
  61. pulumi_newrelic/one_dashboard_raw.py +214 -202
  62. pulumi_newrelic/outputs.py +5491 -2141
  63. pulumi_newrelic/pipeline_cloud_rule.py +335 -0
  64. pulumi_newrelic/plugins/__init__.py +2 -1
  65. pulumi_newrelic/plugins/_inputs.py +520 -90
  66. pulumi_newrelic/plugins/application_settings.py +463 -167
  67. pulumi_newrelic/plugins/outputs.py +337 -75
  68. pulumi_newrelic/plugins/workload.py +387 -151
  69. pulumi_newrelic/provider.py +156 -142
  70. pulumi_newrelic/pulumi-plugin.json +2 -1
  71. pulumi_newrelic/service_level.py +277 -255
  72. pulumi_newrelic/synthetics/__init__.py +2 -1
  73. pulumi_newrelic/synthetics/_inputs.py +275 -106
  74. pulumi_newrelic/synthetics/alert_condition.py +174 -160
  75. pulumi_newrelic/synthetics/broken_links_monitor.py +367 -207
  76. pulumi_newrelic/synthetics/cert_check_monitor.py +380 -218
  77. pulumi_newrelic/synthetics/get_private_location.py +51 -39
  78. pulumi_newrelic/synthetics/get_secure_credential.py +39 -27
  79. pulumi_newrelic/synthetics/monitor.py +668 -462
  80. pulumi_newrelic/synthetics/multi_location_alert_condition.py +219 -201
  81. pulumi_newrelic/synthetics/outputs.py +102 -85
  82. pulumi_newrelic/synthetics/private_location.py +120 -110
  83. pulumi_newrelic/synthetics/script_monitor.py +623 -375
  84. pulumi_newrelic/synthetics/secure_credential.py +99 -93
  85. pulumi_newrelic/synthetics/step_monitor.py +545 -201
  86. pulumi_newrelic/user.py +366 -0
  87. pulumi_newrelic/workflow.py +348 -312
  88. {pulumi_newrelic-5.16.0a1698964311.dist-info → pulumi_newrelic-5.58.0a1763707205.dist-info}/METADATA +8 -7
  89. pulumi_newrelic-5.58.0a1763707205.dist-info/RECORD +92 -0
  90. {pulumi_newrelic-5.16.0a1698964311.dist-info → pulumi_newrelic-5.58.0a1763707205.dist-info}/WHEEL +1 -1
  91. pulumi_newrelic-5.16.0a1698964311.dist-info/RECORD +0 -82
  92. {pulumi_newrelic-5.16.0a1698964311.dist-info → pulumi_newrelic-5.58.0a1763707205.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,17 @@
1
1
  # coding=utf-8
2
- # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
2
+ # *** WARNING: this file was generated by pulumi-language-python. ***
3
3
  # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
4
 
5
- import copy
5
+ import builtins as _builtins
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__ = ['AlertPolicyArgs', 'AlertPolicy']
@@ -14,16 +19,16 @@ __all__ = ['AlertPolicyArgs', 'AlertPolicy']
14
19
  @pulumi.input_type
15
20
  class AlertPolicyArgs:
16
21
  def __init__(__self__, *,
17
- account_id: Optional[pulumi.Input[int]] = None,
18
- channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
19
- incident_preference: Optional[pulumi.Input[str]] = None,
20
- name: Optional[pulumi.Input[str]] = None):
22
+ account_id: Optional[pulumi.Input[_builtins.str]] = None,
23
+ channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
24
+ incident_preference: Optional[pulumi.Input[_builtins.str]] = None,
25
+ name: Optional[pulumi.Input[_builtins.str]] = None):
21
26
  """
22
27
  The set of arguments for constructing a AlertPolicy resource.
23
- :param pulumi.Input[int] account_id: The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
24
- :param pulumi.Input[Sequence[pulumi.Input[int]]] channel_ids: An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported.
25
- :param pulumi.Input[str] incident_preference: The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
26
- :param pulumi.Input[str] name: The name of the policy.
28
+ :param pulumi.Input[_builtins.str] account_id: The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
29
+ :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] channel_ids: An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported.
30
+ :param pulumi.Input[_builtins.str] incident_preference: The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
31
+ :param pulumi.Input[_builtins.str] name: The name of the policy.
27
32
  """
28
33
  if account_id is not None:
29
34
  pulumi.set(__self__, "account_id", account_id)
@@ -37,71 +42,69 @@ class AlertPolicyArgs:
37
42
  if name is not None:
38
43
  pulumi.set(__self__, "name", name)
39
44
 
40
- @property
45
+ @_builtins.property
41
46
  @pulumi.getter(name="accountId")
42
- def account_id(self) -> Optional[pulumi.Input[int]]:
47
+ def account_id(self) -> Optional[pulumi.Input[_builtins.str]]:
43
48
  """
44
49
  The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
45
50
  """
46
51
  return pulumi.get(self, "account_id")
47
52
 
48
53
  @account_id.setter
49
- def account_id(self, value: Optional[pulumi.Input[int]]):
54
+ def account_id(self, value: Optional[pulumi.Input[_builtins.str]]):
50
55
  pulumi.set(self, "account_id", value)
51
56
 
52
- @property
57
+ @_builtins.property
53
58
  @pulumi.getter(name="channelIds")
54
- def channel_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]:
59
+ @_utilities.deprecated("""The `channel_ids` attribute is deprecated and will be removed in the next major release of the provider.""")
60
+ def channel_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]:
55
61
  """
56
62
  An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported.
57
63
  """
58
- warnings.warn("""The `channel_ids` attribute is deprecated and will be removed in the next major release of the provider.""", DeprecationWarning)
59
- pulumi.log.warn("""channel_ids is deprecated: The `channel_ids` attribute is deprecated and will be removed in the next major release of the provider.""")
60
-
61
64
  return pulumi.get(self, "channel_ids")
62
65
 
63
66
  @channel_ids.setter
64
- def channel_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]):
67
+ def channel_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]):
65
68
  pulumi.set(self, "channel_ids", value)
66
69
 
67
- @property
70
+ @_builtins.property
68
71
  @pulumi.getter(name="incidentPreference")
69
- def incident_preference(self) -> Optional[pulumi.Input[str]]:
72
+ def incident_preference(self) -> Optional[pulumi.Input[_builtins.str]]:
70
73
  """
71
74
  The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
72
75
  """
73
76
  return pulumi.get(self, "incident_preference")
74
77
 
75
78
  @incident_preference.setter
76
- def incident_preference(self, value: Optional[pulumi.Input[str]]):
79
+ def incident_preference(self, value: Optional[pulumi.Input[_builtins.str]]):
77
80
  pulumi.set(self, "incident_preference", value)
78
81
 
79
- @property
82
+ @_builtins.property
80
83
  @pulumi.getter
81
- def name(self) -> Optional[pulumi.Input[str]]:
84
+ def name(self) -> Optional[pulumi.Input[_builtins.str]]:
82
85
  """
83
86
  The name of the policy.
84
87
  """
85
88
  return pulumi.get(self, "name")
86
89
 
87
90
  @name.setter
88
- def name(self, value: Optional[pulumi.Input[str]]):
91
+ def name(self, value: Optional[pulumi.Input[_builtins.str]]):
89
92
  pulumi.set(self, "name", value)
90
93
 
91
94
 
92
95
  @pulumi.input_type
93
96
  class _AlertPolicyState:
94
97
  def __init__(__self__, *,
95
- account_id: Optional[pulumi.Input[int]] = None,
96
- channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
97
- incident_preference: Optional[pulumi.Input[str]] = None,
98
- name: Optional[pulumi.Input[str]] = None):
98
+ account_id: Optional[pulumi.Input[_builtins.str]] = None,
99
+ channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
100
+ incident_preference: Optional[pulumi.Input[_builtins.str]] = None,
101
+ name: Optional[pulumi.Input[_builtins.str]] = None):
99
102
  """
100
103
  Input properties used for looking up and filtering AlertPolicy resources.
101
- :param pulumi.Input[int] account_id: The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
102
- :param pulumi.Input[Sequence[pulumi.Input[int]]] channel_ids: An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported.
103
- :param pulumi.Input[str] incident_preference: The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
104
- :param pulumi.Input[str] name: The name of the policy.
104
+ :param pulumi.Input[_builtins.str] account_id: The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
105
+ :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] channel_ids: An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported.
106
+ :param pulumi.Input[_builtins.str] incident_preference: The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
107
+ :param pulumi.Input[_builtins.str] name: The name of the policy.
105
108
  """
106
109
  if account_id is not None:
107
110
  pulumi.set(__self__, "account_id", account_id)
@@ -115,117 +118,140 @@ class _AlertPolicyState:
115
118
  if name is not None:
116
119
  pulumi.set(__self__, "name", name)
117
120
 
118
- @property
121
+ @_builtins.property
119
122
  @pulumi.getter(name="accountId")
120
- def account_id(self) -> Optional[pulumi.Input[int]]:
123
+ def account_id(self) -> Optional[pulumi.Input[_builtins.str]]:
121
124
  """
122
125
  The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
123
126
  """
124
127
  return pulumi.get(self, "account_id")
125
128
 
126
129
  @account_id.setter
127
- def account_id(self, value: Optional[pulumi.Input[int]]):
130
+ def account_id(self, value: Optional[pulumi.Input[_builtins.str]]):
128
131
  pulumi.set(self, "account_id", value)
129
132
 
130
- @property
133
+ @_builtins.property
131
134
  @pulumi.getter(name="channelIds")
132
- def channel_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]:
135
+ @_utilities.deprecated("""The `channel_ids` attribute is deprecated and will be removed in the next major release of the provider.""")
136
+ def channel_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]:
133
137
  """
134
138
  An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported.
135
139
  """
136
- warnings.warn("""The `channel_ids` attribute is deprecated and will be removed in the next major release of the provider.""", DeprecationWarning)
137
- pulumi.log.warn("""channel_ids is deprecated: The `channel_ids` attribute is deprecated and will be removed in the next major release of the provider.""")
138
-
139
140
  return pulumi.get(self, "channel_ids")
140
141
 
141
142
  @channel_ids.setter
142
- def channel_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]):
143
+ def channel_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]):
143
144
  pulumi.set(self, "channel_ids", value)
144
145
 
145
- @property
146
+ @_builtins.property
146
147
  @pulumi.getter(name="incidentPreference")
147
- def incident_preference(self) -> Optional[pulumi.Input[str]]:
148
+ def incident_preference(self) -> Optional[pulumi.Input[_builtins.str]]:
148
149
  """
149
150
  The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
150
151
  """
151
152
  return pulumi.get(self, "incident_preference")
152
153
 
153
154
  @incident_preference.setter
154
- def incident_preference(self, value: Optional[pulumi.Input[str]]):
155
+ def incident_preference(self, value: Optional[pulumi.Input[_builtins.str]]):
155
156
  pulumi.set(self, "incident_preference", value)
156
157
 
157
- @property
158
+ @_builtins.property
158
159
  @pulumi.getter
159
- def name(self) -> Optional[pulumi.Input[str]]:
160
+ def name(self) -> Optional[pulumi.Input[_builtins.str]]:
160
161
  """
161
162
  The name of the policy.
162
163
  """
163
164
  return pulumi.get(self, "name")
164
165
 
165
166
  @name.setter
166
- def name(self, value: Optional[pulumi.Input[str]]):
167
+ def name(self, value: Optional[pulumi.Input[_builtins.str]]):
167
168
  pulumi.set(self, "name", value)
168
169
 
169
170
 
171
+ @pulumi.type_token("newrelic:index/alertPolicy:AlertPolicy")
170
172
  class AlertPolicy(pulumi.CustomResource):
171
173
  @overload
172
174
  def __init__(__self__,
173
175
  resource_name: str,
174
176
  opts: Optional[pulumi.ResourceOptions] = None,
175
- account_id: Optional[pulumi.Input[int]] = None,
176
- channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
177
- incident_preference: Optional[pulumi.Input[str]] = None,
178
- name: Optional[pulumi.Input[str]] = None,
177
+ account_id: Optional[pulumi.Input[_builtins.str]] = None,
178
+ channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
179
+ incident_preference: Optional[pulumi.Input[_builtins.str]] = None,
180
+ name: Optional[pulumi.Input[_builtins.str]] = None,
179
181
  __props__=None):
180
182
  """
181
183
  Use this resource to create and manage New Relic alert policies.
182
184
 
183
185
  ## Example Usage
186
+
184
187
  ### Basic Usage
185
188
 
186
189
  ```python
187
190
  import pulumi
188
191
  import pulumi_newrelic as newrelic
189
192
 
190
- foo = newrelic.AlertPolicy("foo", incident_preference="PER_POLICY")
193
+ foo = newrelic.AlertPolicy("foo",
194
+ name="example",
195
+ incident_preference="PER_POLICY")
191
196
  ```
197
+
192
198
  ### Provision multiple notification channels and add those channels to a policy
193
199
 
200
+ The following arguments are supported:
201
+
202
+ * `name` - (Required) The name of the policy.
203
+ * `incident_preference` - (Optional) The rollup strategy for the policy, which can have one of the following values (the default value is `PER_POLICY`):
204
+ * `PER_POLICY` - This sets the incident grouping preference of the policy to **One issue per policy**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-policy) for more details on this incident grouping preference.
205
+ * `PER_CONDITION` - This sets the incident grouping preference of the policy to **One issue per condition**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-condition) for more details on this incident grouping preference.
206
+ * `PER_CONDITION_AND_TARGET` - This sets the incident grouping preference of the policy to **One issue per condition and signal**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-signal) for more details on this incident grouping preference.
207
+ * `channel_ids` - (Optional) **DEPRECATED** The `channel_ids` argument is deprecated and will be removed in the next major release of the provider. An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported via `pulumi import` (see Import for info).
208
+ * `account_id` - (Optional) The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
209
+
210
+ ## Additional Examples
211
+
212
+ ##### Provision multiple notification channels and add those channels to a policy
194
213
  ```python
195
214
  import pulumi
196
215
  import pulumi_newrelic as newrelic
197
216
 
198
217
  # Provision a Slack notification channel.
199
- slack_channel = newrelic.AlertChannel("slackChannel",
218
+ slack_channel = newrelic.AlertChannel("slack_channel",
219
+ name="slack-example",
200
220
  type="slack",
201
- config=newrelic.AlertChannelConfigArgs(
202
- url="https://hooks.slack.com/services/xxxxxxx/yyyyyyyy",
203
- channel="example-alerts-channel",
204
- ))
221
+ config={
222
+ "url": "https://hooks.slack.com/services/xxxxxxx/yyyyyyyy",
223
+ "channel": "example-alerts-channel",
224
+ })
205
225
  # Provision an email notification channel.
206
- email_channel = newrelic.AlertChannel("emailChannel",
226
+ email_channel = newrelic.AlertChannel("email_channel",
227
+ name="email-example",
207
228
  type="email",
208
- config=newrelic.AlertChannelConfigArgs(
209
- recipients="example@testing.com",
210
- include_json_attachment="1",
211
- ))
229
+ config={
230
+ "recipients": "example@testing.com",
231
+ "include_json_attachment": "1",
232
+ })
212
233
  # Provision the alert policy.
213
- policy_with_channels = newrelic.AlertPolicy("policyWithChannels",
234
+ policy_with_channels = newrelic.AlertPolicy("policy_with_channels",
235
+ name="example-with-channels",
214
236
  incident_preference="PER_CONDITION",
215
237
  channel_ids=[
216
238
  slack_channel.id,
217
239
  email_channel.id,
218
240
  ])
219
241
  ```
242
+
220
243
  ### Reference existing notification channels and add those channel to a policy
221
244
  ```python
222
245
  import pulumi
223
246
  import pulumi_newrelic as newrelic
224
247
 
248
+ # Reference an existing Slack notification channel.
225
249
  slack_channel = newrelic.get_alert_channel(name="slack-channel-notification")
250
+ # Reference an existing email notification channel.
226
251
  email_channel = newrelic.get_alert_channel(name="test@example.com")
227
252
  # Provision the alert policy.
228
- policy_with_channels = newrelic.AlertPolicy("policyWithChannels",
253
+ policy_with_channels = newrelic.AlertPolicy("policy_with_channels",
254
+ name="example-with-channels",
229
255
  incident_preference="PER_CONDITION",
230
256
  channel_ids=[
231
257
  slack_channel.id,
@@ -240,16 +266,16 @@ class AlertPolicy(pulumi.CustomResource):
240
266
  Example import:
241
267
 
242
268
  ```sh
243
- $ pulumi import newrelic:index/alertPolicy:AlertPolicy foo 23423556:4593020
269
+ $ pulumi import newrelic:index/alertPolicy:AlertPolicy foo 23423556:4593020
244
270
  ```
245
- Please note that channel IDs (`channel_ids`) _cannot_ be imported due channels being a separate resource. However, to add channels to an imported alert policy, you can import the policy, add the `channel_ids` attribute with the associated channel IDs, then run `pulumi up`. This will result in the original alert policy being destroyed and a new alert policy being created along with the channels being added to the policy.
271
+ Please note that channel IDs (`channel_ids`) _cannot_ be imported due channels being a separate resource. However, to add channels to an imported alert policy, you can import the policy, add the `channel_ids` attribute with the associated channel IDs, then run `pulumi up`. This will result in the original alert policy being destroyed and a new alert policy being created along with the channels being added to the policy.
246
272
 
247
273
  :param str resource_name: The name of the resource.
248
274
  :param pulumi.ResourceOptions opts: Options for the resource.
249
- :param pulumi.Input[int] account_id: The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
250
- :param pulumi.Input[Sequence[pulumi.Input[int]]] channel_ids: An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported.
251
- :param pulumi.Input[str] incident_preference: The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
252
- :param pulumi.Input[str] name: The name of the policy.
275
+ :param pulumi.Input[_builtins.str] account_id: The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
276
+ :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] channel_ids: An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported.
277
+ :param pulumi.Input[_builtins.str] incident_preference: The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
278
+ :param pulumi.Input[_builtins.str] name: The name of the policy.
253
279
  """
254
280
  ...
255
281
  @overload
@@ -261,51 +287,75 @@ class AlertPolicy(pulumi.CustomResource):
261
287
  Use this resource to create and manage New Relic alert policies.
262
288
 
263
289
  ## Example Usage
290
+
264
291
  ### Basic Usage
265
292
 
266
293
  ```python
267
294
  import pulumi
268
295
  import pulumi_newrelic as newrelic
269
296
 
270
- foo = newrelic.AlertPolicy("foo", incident_preference="PER_POLICY")
297
+ foo = newrelic.AlertPolicy("foo",
298
+ name="example",
299
+ incident_preference="PER_POLICY")
271
300
  ```
301
+
272
302
  ### Provision multiple notification channels and add those channels to a policy
273
303
 
304
+ The following arguments are supported:
305
+
306
+ * `name` - (Required) The name of the policy.
307
+ * `incident_preference` - (Optional) The rollup strategy for the policy, which can have one of the following values (the default value is `PER_POLICY`):
308
+ * `PER_POLICY` - This sets the incident grouping preference of the policy to **One issue per policy**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-policy) for more details on this incident grouping preference.
309
+ * `PER_CONDITION` - This sets the incident grouping preference of the policy to **One issue per condition**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-condition) for more details on this incident grouping preference.
310
+ * `PER_CONDITION_AND_TARGET` - This sets the incident grouping preference of the policy to **One issue per condition and signal**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-signal) for more details on this incident grouping preference.
311
+ * `channel_ids` - (Optional) **DEPRECATED** The `channel_ids` argument is deprecated and will be removed in the next major release of the provider. An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported via `pulumi import` (see Import for info).
312
+ * `account_id` - (Optional) The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
313
+
314
+ ## Additional Examples
315
+
316
+ ##### Provision multiple notification channels and add those channels to a policy
274
317
  ```python
275
318
  import pulumi
276
319
  import pulumi_newrelic as newrelic
277
320
 
278
321
  # Provision a Slack notification channel.
279
- slack_channel = newrelic.AlertChannel("slackChannel",
322
+ slack_channel = newrelic.AlertChannel("slack_channel",
323
+ name="slack-example",
280
324
  type="slack",
281
- config=newrelic.AlertChannelConfigArgs(
282
- url="https://hooks.slack.com/services/xxxxxxx/yyyyyyyy",
283
- channel="example-alerts-channel",
284
- ))
325
+ config={
326
+ "url": "https://hooks.slack.com/services/xxxxxxx/yyyyyyyy",
327
+ "channel": "example-alerts-channel",
328
+ })
285
329
  # Provision an email notification channel.
286
- email_channel = newrelic.AlertChannel("emailChannel",
330
+ email_channel = newrelic.AlertChannel("email_channel",
331
+ name="email-example",
287
332
  type="email",
288
- config=newrelic.AlertChannelConfigArgs(
289
- recipients="example@testing.com",
290
- include_json_attachment="1",
291
- ))
333
+ config={
334
+ "recipients": "example@testing.com",
335
+ "include_json_attachment": "1",
336
+ })
292
337
  # Provision the alert policy.
293
- policy_with_channels = newrelic.AlertPolicy("policyWithChannels",
338
+ policy_with_channels = newrelic.AlertPolicy("policy_with_channels",
339
+ name="example-with-channels",
294
340
  incident_preference="PER_CONDITION",
295
341
  channel_ids=[
296
342
  slack_channel.id,
297
343
  email_channel.id,
298
344
  ])
299
345
  ```
346
+
300
347
  ### Reference existing notification channels and add those channel to a policy
301
348
  ```python
302
349
  import pulumi
303
350
  import pulumi_newrelic as newrelic
304
351
 
352
+ # Reference an existing Slack notification channel.
305
353
  slack_channel = newrelic.get_alert_channel(name="slack-channel-notification")
354
+ # Reference an existing email notification channel.
306
355
  email_channel = newrelic.get_alert_channel(name="test@example.com")
307
356
  # Provision the alert policy.
308
- policy_with_channels = newrelic.AlertPolicy("policyWithChannels",
357
+ policy_with_channels = newrelic.AlertPolicy("policy_with_channels",
358
+ name="example-with-channels",
309
359
  incident_preference="PER_CONDITION",
310
360
  channel_ids=[
311
361
  slack_channel.id,
@@ -320,9 +370,9 @@ class AlertPolicy(pulumi.CustomResource):
320
370
  Example import:
321
371
 
322
372
  ```sh
323
- $ pulumi import newrelic:index/alertPolicy:AlertPolicy foo 23423556:4593020
373
+ $ pulumi import newrelic:index/alertPolicy:AlertPolicy foo 23423556:4593020
324
374
  ```
325
- Please note that channel IDs (`channel_ids`) _cannot_ be imported due channels being a separate resource. However, to add channels to an imported alert policy, you can import the policy, add the `channel_ids` attribute with the associated channel IDs, then run `pulumi up`. This will result in the original alert policy being destroyed and a new alert policy being created along with the channels being added to the policy.
375
+ Please note that channel IDs (`channel_ids`) _cannot_ be imported due channels being a separate resource. However, to add channels to an imported alert policy, you can import the policy, add the `channel_ids` attribute with the associated channel IDs, then run `pulumi up`. This will result in the original alert policy being destroyed and a new alert policy being created along with the channels being added to the policy.
326
376
 
327
377
  :param str resource_name: The name of the resource.
328
378
  :param AlertPolicyArgs args: The arguments to use to populate this resource's properties.
@@ -339,10 +389,10 @@ class AlertPolicy(pulumi.CustomResource):
339
389
  def _internal_init(__self__,
340
390
  resource_name: str,
341
391
  opts: Optional[pulumi.ResourceOptions] = None,
342
- account_id: Optional[pulumi.Input[int]] = None,
343
- channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
344
- incident_preference: Optional[pulumi.Input[str]] = None,
345
- name: Optional[pulumi.Input[str]] = None,
392
+ account_id: Optional[pulumi.Input[_builtins.str]] = None,
393
+ channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
394
+ incident_preference: Optional[pulumi.Input[_builtins.str]] = None,
395
+ name: Optional[pulumi.Input[_builtins.str]] = None,
346
396
  __props__=None):
347
397
  opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
348
398
  if not isinstance(opts, pulumi.ResourceOptions):
@@ -366,10 +416,10 @@ class AlertPolicy(pulumi.CustomResource):
366
416
  def get(resource_name: str,
367
417
  id: pulumi.Input[str],
368
418
  opts: Optional[pulumi.ResourceOptions] = None,
369
- account_id: Optional[pulumi.Input[int]] = None,
370
- channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
371
- incident_preference: Optional[pulumi.Input[str]] = None,
372
- name: Optional[pulumi.Input[str]] = None) -> 'AlertPolicy':
419
+ account_id: Optional[pulumi.Input[_builtins.str]] = None,
420
+ channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
421
+ incident_preference: Optional[pulumi.Input[_builtins.str]] = None,
422
+ name: Optional[pulumi.Input[_builtins.str]] = None) -> 'AlertPolicy':
373
423
  """
374
424
  Get an existing AlertPolicy resource's state with the given name, id, and optional extra
375
425
  properties used to qualify the lookup.
@@ -377,10 +427,10 @@ class AlertPolicy(pulumi.CustomResource):
377
427
  :param str resource_name: The unique name of the resulting resource.
378
428
  :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
379
429
  :param pulumi.ResourceOptions opts: Options for the resource.
380
- :param pulumi.Input[int] account_id: The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
381
- :param pulumi.Input[Sequence[pulumi.Input[int]]] channel_ids: An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported.
382
- :param pulumi.Input[str] incident_preference: The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
383
- :param pulumi.Input[str] name: The name of the policy.
430
+ :param pulumi.Input[_builtins.str] account_id: The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
431
+ :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] channel_ids: An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported.
432
+ :param pulumi.Input[_builtins.str] incident_preference: The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
433
+ :param pulumi.Input[_builtins.str] name: The name of the policy.
384
434
  """
385
435
  opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
386
436
 
@@ -392,36 +442,34 @@ class AlertPolicy(pulumi.CustomResource):
392
442
  __props__.__dict__["name"] = name
393
443
  return AlertPolicy(resource_name, opts=opts, __props__=__props__)
394
444
 
395
- @property
445
+ @_builtins.property
396
446
  @pulumi.getter(name="accountId")
397
- def account_id(self) -> pulumi.Output[int]:
447
+ def account_id(self) -> pulumi.Output[_builtins.str]:
398
448
  """
399
449
  The New Relic account ID to operate on. This allows the user to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
400
450
  """
401
451
  return pulumi.get(self, "account_id")
402
452
 
403
- @property
453
+ @_builtins.property
404
454
  @pulumi.getter(name="channelIds")
405
- def channel_ids(self) -> pulumi.Output[Optional[Sequence[int]]]:
455
+ @_utilities.deprecated("""The `channel_ids` attribute is deprecated and will be removed in the next major release of the provider.""")
456
+ def channel_ids(self) -> pulumi.Output[Optional[Sequence[_builtins.str]]]:
406
457
  """
407
458
  An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported.
408
459
  """
409
- warnings.warn("""The `channel_ids` attribute is deprecated and will be removed in the next major release of the provider.""", DeprecationWarning)
410
- pulumi.log.warn("""channel_ids is deprecated: The `channel_ids` attribute is deprecated and will be removed in the next major release of the provider.""")
411
-
412
460
  return pulumi.get(self, "channel_ids")
413
461
 
414
- @property
462
+ @_builtins.property
415
463
  @pulumi.getter(name="incidentPreference")
416
- def incident_preference(self) -> pulumi.Output[Optional[str]]:
464
+ def incident_preference(self) -> pulumi.Output[Optional[_builtins.str]]:
417
465
  """
418
466
  The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
419
467
  """
420
468
  return pulumi.get(self, "incident_preference")
421
469
 
422
- @property
470
+ @_builtins.property
423
471
  @pulumi.getter
424
- def name(self) -> pulumi.Output[str]:
472
+ def name(self) -> pulumi.Output[_builtins.str]:
425
473
  """
426
474
  The name of the policy.
427
475
  """