pulumi-newrelic 5.22.0__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 +28 -1
  2. pulumi_newrelic/_inputs.py +10385 -2976
  3. pulumi_newrelic/_utilities.py +50 -10
  4. pulumi_newrelic/account_management.py +48 -42
  5. pulumi_newrelic/alert_channel.py +165 -175
  6. pulumi_newrelic/alert_condition.py +307 -319
  7. pulumi_newrelic/alert_muting_rule.py +193 -140
  8. pulumi_newrelic/alert_policy.py +121 -117
  9. pulumi_newrelic/alert_policy_channel.py +89 -79
  10. pulumi_newrelic/api_access_key.py +195 -193
  11. pulumi_newrelic/browser_application.py +120 -114
  12. pulumi_newrelic/cloud/__init__.py +3 -1
  13. pulumi_newrelic/cloud/_inputs.py +4267 -2714
  14. pulumi_newrelic/cloud/aws_govcloud_integrations.py +206 -196
  15. pulumi_newrelic/cloud/aws_govcloud_link_account.py +143 -228
  16. pulumi_newrelic/cloud/aws_integrations.py +510 -1490
  17. pulumi_newrelic/cloud/aws_link_account.py +80 -76
  18. pulumi_newrelic/cloud/azure_integrations.py +673 -587
  19. pulumi_newrelic/cloud/azure_link_account.py +121 -117
  20. pulumi_newrelic/cloud/gcp_integrations.py +428 -408
  21. pulumi_newrelic/cloud/gcp_link_account.py +65 -61
  22. pulumi_newrelic/cloud/oci_link_account.py +926 -0
  23. pulumi_newrelic/cloud/outputs.py +1678 -2321
  24. pulumi_newrelic/config/__init__.py +2 -1
  25. pulumi_newrelic/config/__init__.pyi +8 -3
  26. pulumi_newrelic/config/vars.py +22 -17
  27. pulumi_newrelic/data_partition_rule.py +119 -117
  28. pulumi_newrelic/entity_tags.py +111 -53
  29. pulumi_newrelic/events_to_metrics_rule.py +106 -102
  30. pulumi_newrelic/get_account.py +41 -33
  31. pulumi_newrelic/get_alert_channel.py +73 -28
  32. pulumi_newrelic/get_alert_policy.py +82 -33
  33. pulumi_newrelic/get_application.py +51 -43
  34. pulumi_newrelic/get_authentication_domain.py +27 -23
  35. pulumi_newrelic/get_cloud_account.py +43 -35
  36. pulumi_newrelic/get_entity.py +126 -183
  37. pulumi_newrelic/get_group.py +76 -31
  38. pulumi_newrelic/get_key_transaction.py +117 -42
  39. pulumi_newrelic/get_notification_destination.py +75 -38
  40. pulumi_newrelic/get_obfuscation_expression.py +47 -39
  41. pulumi_newrelic/get_service_level_alert_helper.py +189 -171
  42. pulumi_newrelic/get_test_grok_pattern.py +47 -36
  43. pulumi_newrelic/get_user.py +39 -31
  44. pulumi_newrelic/group.py +59 -199
  45. pulumi_newrelic/infra_alert_condition.py +399 -405
  46. pulumi_newrelic/insights/__init__.py +2 -1
  47. pulumi_newrelic/insights/_inputs.py +71 -28
  48. pulumi_newrelic/insights/event.py +54 -52
  49. pulumi_newrelic/insights/outputs.py +28 -23
  50. pulumi_newrelic/key_transaction.py +465 -0
  51. pulumi_newrelic/log_parsing_rule.py +159 -157
  52. pulumi_newrelic/monitor_downtime.py +311 -331
  53. pulumi_newrelic/notification_channel.py +534 -464
  54. pulumi_newrelic/notification_destination.py +238 -141
  55. pulumi_newrelic/nrql_alert_condition.py +820 -614
  56. pulumi_newrelic/nrql_drop_rule.py +113 -151
  57. pulumi_newrelic/obfuscation_expression.py +80 -76
  58. pulumi_newrelic/obfuscation_rule.py +115 -109
  59. pulumi_newrelic/one_dashboard.py +110 -104
  60. pulumi_newrelic/one_dashboard_json.py +69 -63
  61. pulumi_newrelic/one_dashboard_raw.py +212 -206
  62. pulumi_newrelic/outputs.py +4936 -2234
  63. pulumi_newrelic/pipeline_cloud_rule.py +335 -0
  64. pulumi_newrelic/plugins/__init__.py +2 -1
  65. pulumi_newrelic/plugins/_inputs.py +519 -89
  66. pulumi_newrelic/plugins/application_settings.py +463 -187
  67. pulumi_newrelic/plugins/outputs.py +336 -74
  68. pulumi_newrelic/plugins/workload.py +313 -189
  69. pulumi_newrelic/provider.py +156 -142
  70. pulumi_newrelic/pulumi-plugin.json +2 -1
  71. pulumi_newrelic/service_level.py +263 -263
  72. pulumi_newrelic/synthetics/__init__.py +2 -1
  73. pulumi_newrelic/synthetics/_inputs.py +265 -108
  74. pulumi_newrelic/synthetics/alert_condition.py +170 -180
  75. pulumi_newrelic/synthetics/broken_links_monitor.py +297 -249
  76. pulumi_newrelic/synthetics/cert_check_monitor.py +306 -258
  77. pulumi_newrelic/synthetics/get_private_location.py +51 -47
  78. pulumi_newrelic/synthetics/get_secure_credential.py +39 -31
  79. pulumi_newrelic/synthetics/monitor.py +658 -460
  80. pulumi_newrelic/synthetics/multi_location_alert_condition.py +211 -205
  81. pulumi_newrelic/synthetics/outputs.py +92 -87
  82. pulumi_newrelic/synthetics/private_location.py +118 -112
  83. pulumi_newrelic/synthetics/script_monitor.py +613 -373
  84. pulumi_newrelic/synthetics/secure_credential.py +97 -95
  85. pulumi_newrelic/synthetics/step_monitor.py +445 -275
  86. pulumi_newrelic/user.py +84 -80
  87. pulumi_newrelic/workflow.py +336 -322
  88. {pulumi_newrelic-5.22.0.dist-info → pulumi_newrelic-5.58.0a1763707205.dist-info}/METADATA +7 -6
  89. pulumi_newrelic-5.58.0a1763707205.dist-info/RECORD +92 -0
  90. {pulumi_newrelic-5.22.0.dist-info → pulumi_newrelic-5.58.0a1763707205.dist-info}/WHEEL +1 -1
  91. pulumi_newrelic-5.22.0.dist-info/RECORD +0 -89
  92. {pulumi_newrelic-5.22.0.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,67 +118,66 @@ 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.
@@ -184,14 +186,14 @@ class AlertPolicy(pulumi.CustomResource):
184
186
 
185
187
  ### Basic Usage
186
188
 
187
- <!--Start PulumiCodeChooser -->
188
189
  ```python
189
190
  import pulumi
190
191
  import pulumi_newrelic as newrelic
191
192
 
192
- foo = newrelic.AlertPolicy("foo", incident_preference="PER_POLICY")
193
+ foo = newrelic.AlertPolicy("foo",
194
+ name="example",
195
+ incident_preference="PER_POLICY")
193
196
  ```
194
- <!--End PulumiCodeChooser -->
195
197
 
196
198
  ### Provision multiple notification channels and add those channels to a policy
197
199
 
@@ -208,52 +210,54 @@ class AlertPolicy(pulumi.CustomResource):
208
210
  ## Additional Examples
209
211
 
210
212
  ##### Provision multiple notification channels and add those channels to a policy
211
- <!--Start PulumiCodeChooser -->
212
213
  ```python
213
214
  import pulumi
214
215
  import pulumi_newrelic as newrelic
215
216
 
216
217
  # Provision a Slack notification channel.
217
- slack_channel = newrelic.AlertChannel("slackChannel",
218
+ slack_channel = newrelic.AlertChannel("slack_channel",
219
+ name="slack-example",
218
220
  type="slack",
219
- config=newrelic.AlertChannelConfigArgs(
220
- url="https://hooks.slack.com/services/xxxxxxx/yyyyyyyy",
221
- channel="example-alerts-channel",
222
- ))
221
+ config={
222
+ "url": "https://hooks.slack.com/services/xxxxxxx/yyyyyyyy",
223
+ "channel": "example-alerts-channel",
224
+ })
223
225
  # Provision an email notification channel.
224
- email_channel = newrelic.AlertChannel("emailChannel",
226
+ email_channel = newrelic.AlertChannel("email_channel",
227
+ name="email-example",
225
228
  type="email",
226
- config=newrelic.AlertChannelConfigArgs(
227
- recipients="example@testing.com",
228
- include_json_attachment="1",
229
- ))
229
+ config={
230
+ "recipients": "example@testing.com",
231
+ "include_json_attachment": "1",
232
+ })
230
233
  # Provision the alert policy.
231
- policy_with_channels = newrelic.AlertPolicy("policyWithChannels",
234
+ policy_with_channels = newrelic.AlertPolicy("policy_with_channels",
235
+ name="example-with-channels",
232
236
  incident_preference="PER_CONDITION",
233
237
  channel_ids=[
234
238
  slack_channel.id,
235
239
  email_channel.id,
236
240
  ])
237
241
  ```
238
- <!--End PulumiCodeChooser -->
239
242
 
240
243
  ### Reference existing notification channels and add those channel to a policy
241
- <!--Start PulumiCodeChooser -->
242
244
  ```python
243
245
  import pulumi
244
246
  import pulumi_newrelic as newrelic
245
247
 
248
+ # Reference an existing Slack notification channel.
246
249
  slack_channel = newrelic.get_alert_channel(name="slack-channel-notification")
250
+ # Reference an existing email notification channel.
247
251
  email_channel = newrelic.get_alert_channel(name="test@example.com")
248
252
  # Provision the alert policy.
249
- policy_with_channels = newrelic.AlertPolicy("policyWithChannels",
253
+ policy_with_channels = newrelic.AlertPolicy("policy_with_channels",
254
+ name="example-with-channels",
250
255
  incident_preference="PER_CONDITION",
251
256
  channel_ids=[
252
257
  slack_channel.id,
253
258
  email_channel.id,
254
259
  ])
255
260
  ```
256
- <!--End PulumiCodeChooser -->
257
261
 
258
262
  ## Import
259
263
 
@@ -268,10 +272,10 @@ class AlertPolicy(pulumi.CustomResource):
268
272
 
269
273
  :param str resource_name: The name of the resource.
270
274
  :param pulumi.ResourceOptions opts: Options for the resource.
271
- :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`.
272
- :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.
273
- :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`.
274
- :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.
275
279
  """
276
280
  ...
277
281
  @overload
@@ -286,14 +290,14 @@ class AlertPolicy(pulumi.CustomResource):
286
290
 
287
291
  ### Basic Usage
288
292
 
289
- <!--Start PulumiCodeChooser -->
290
293
  ```python
291
294
  import pulumi
292
295
  import pulumi_newrelic as newrelic
293
296
 
294
- foo = newrelic.AlertPolicy("foo", incident_preference="PER_POLICY")
297
+ foo = newrelic.AlertPolicy("foo",
298
+ name="example",
299
+ incident_preference="PER_POLICY")
295
300
  ```
296
- <!--End PulumiCodeChooser -->
297
301
 
298
302
  ### Provision multiple notification channels and add those channels to a policy
299
303
 
@@ -310,52 +314,54 @@ class AlertPolicy(pulumi.CustomResource):
310
314
  ## Additional Examples
311
315
 
312
316
  ##### Provision multiple notification channels and add those channels to a policy
313
- <!--Start PulumiCodeChooser -->
314
317
  ```python
315
318
  import pulumi
316
319
  import pulumi_newrelic as newrelic
317
320
 
318
321
  # Provision a Slack notification channel.
319
- slack_channel = newrelic.AlertChannel("slackChannel",
322
+ slack_channel = newrelic.AlertChannel("slack_channel",
323
+ name="slack-example",
320
324
  type="slack",
321
- config=newrelic.AlertChannelConfigArgs(
322
- url="https://hooks.slack.com/services/xxxxxxx/yyyyyyyy",
323
- channel="example-alerts-channel",
324
- ))
325
+ config={
326
+ "url": "https://hooks.slack.com/services/xxxxxxx/yyyyyyyy",
327
+ "channel": "example-alerts-channel",
328
+ })
325
329
  # Provision an email notification channel.
326
- email_channel = newrelic.AlertChannel("emailChannel",
330
+ email_channel = newrelic.AlertChannel("email_channel",
331
+ name="email-example",
327
332
  type="email",
328
- config=newrelic.AlertChannelConfigArgs(
329
- recipients="example@testing.com",
330
- include_json_attachment="1",
331
- ))
333
+ config={
334
+ "recipients": "example@testing.com",
335
+ "include_json_attachment": "1",
336
+ })
332
337
  # Provision the alert policy.
333
- policy_with_channels = newrelic.AlertPolicy("policyWithChannels",
338
+ policy_with_channels = newrelic.AlertPolicy("policy_with_channels",
339
+ name="example-with-channels",
334
340
  incident_preference="PER_CONDITION",
335
341
  channel_ids=[
336
342
  slack_channel.id,
337
343
  email_channel.id,
338
344
  ])
339
345
  ```
340
- <!--End PulumiCodeChooser -->
341
346
 
342
347
  ### Reference existing notification channels and add those channel to a policy
343
- <!--Start PulumiCodeChooser -->
344
348
  ```python
345
349
  import pulumi
346
350
  import pulumi_newrelic as newrelic
347
351
 
352
+ # Reference an existing Slack notification channel.
348
353
  slack_channel = newrelic.get_alert_channel(name="slack-channel-notification")
354
+ # Reference an existing email notification channel.
349
355
  email_channel = newrelic.get_alert_channel(name="test@example.com")
350
356
  # Provision the alert policy.
351
- policy_with_channels = newrelic.AlertPolicy("policyWithChannels",
357
+ policy_with_channels = newrelic.AlertPolicy("policy_with_channels",
358
+ name="example-with-channels",
352
359
  incident_preference="PER_CONDITION",
353
360
  channel_ids=[
354
361
  slack_channel.id,
355
362
  email_channel.id,
356
363
  ])
357
364
  ```
358
- <!--End PulumiCodeChooser -->
359
365
 
360
366
  ## Import
361
367
 
@@ -383,10 +389,10 @@ class AlertPolicy(pulumi.CustomResource):
383
389
  def _internal_init(__self__,
384
390
  resource_name: str,
385
391
  opts: Optional[pulumi.ResourceOptions] = None,
386
- account_id: Optional[pulumi.Input[int]] = None,
387
- channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
388
- incident_preference: Optional[pulumi.Input[str]] = None,
389
- 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,
390
396
  __props__=None):
391
397
  opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
392
398
  if not isinstance(opts, pulumi.ResourceOptions):
@@ -410,10 +416,10 @@ class AlertPolicy(pulumi.CustomResource):
410
416
  def get(resource_name: str,
411
417
  id: pulumi.Input[str],
412
418
  opts: Optional[pulumi.ResourceOptions] = None,
413
- account_id: Optional[pulumi.Input[int]] = None,
414
- channel_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
415
- incident_preference: Optional[pulumi.Input[str]] = None,
416
- 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':
417
423
  """
418
424
  Get an existing AlertPolicy resource's state with the given name, id, and optional extra
419
425
  properties used to qualify the lookup.
@@ -421,10 +427,10 @@ class AlertPolicy(pulumi.CustomResource):
421
427
  :param str resource_name: The unique name of the resulting resource.
422
428
  :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
423
429
  :param pulumi.ResourceOptions opts: Options for the resource.
424
- :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`.
425
- :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.
426
- :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`.
427
- :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.
428
434
  """
429
435
  opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
430
436
 
@@ -436,36 +442,34 @@ class AlertPolicy(pulumi.CustomResource):
436
442
  __props__.__dict__["name"] = name
437
443
  return AlertPolicy(resource_name, opts=opts, __props__=__props__)
438
444
 
439
- @property
445
+ @_builtins.property
440
446
  @pulumi.getter(name="accountId")
441
- def account_id(self) -> pulumi.Output[int]:
447
+ def account_id(self) -> pulumi.Output[_builtins.str]:
442
448
  """
443
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`.
444
450
  """
445
451
  return pulumi.get(self, "account_id")
446
452
 
447
- @property
453
+ @_builtins.property
448
454
  @pulumi.getter(name="channelIds")
449
- 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]]]:
450
457
  """
451
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.
452
459
  """
453
- warnings.warn("""The `channel_ids` attribute is deprecated and will be removed in the next major release of the provider.""", DeprecationWarning)
454
- 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.""")
455
-
456
460
  return pulumi.get(self, "channel_ids")
457
461
 
458
- @property
462
+ @_builtins.property
459
463
  @pulumi.getter(name="incidentPreference")
460
- def incident_preference(self) -> pulumi.Output[Optional[str]]:
464
+ def incident_preference(self) -> pulumi.Output[Optional[_builtins.str]]:
461
465
  """
462
466
  The rollup strategy for the policy. Options include: `PER_POLICY`, `PER_CONDITION`, or `PER_CONDITION_AND_TARGET`. The default is `PER_POLICY`.
463
467
  """
464
468
  return pulumi.get(self, "incident_preference")
465
469
 
466
- @property
470
+ @_builtins.property
467
471
  @pulumi.getter
468
- def name(self) -> pulumi.Output[str]:
472
+ def name(self) -> pulumi.Output[_builtins.str]:
469
473
  """
470
474
  The name of the policy.
471
475
  """