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
  from . import outputs
12
17
  from ._inputs import *
@@ -16,16 +21,16 @@ __all__ = ['AlertChannelArgs', 'AlertChannel']
16
21
  @pulumi.input_type
17
22
  class AlertChannelArgs:
18
23
  def __init__(__self__, *,
19
- type: pulumi.Input[str],
20
- account_id: Optional[pulumi.Input[int]] = None,
24
+ type: pulumi.Input[_builtins.str],
25
+ account_id: Optional[pulumi.Input[_builtins.str]] = None,
21
26
  config: Optional[pulumi.Input['AlertChannelConfigArgs']] = None,
22
- name: Optional[pulumi.Input[str]] = None):
27
+ name: Optional[pulumi.Input[_builtins.str]] = None):
23
28
  """
24
29
  The set of arguments for constructing a AlertChannel resource.
25
- :param pulumi.Input[str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
26
- :param pulumi.Input[int] account_id: Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
30
+ :param pulumi.Input[_builtins.str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
31
+ :param pulumi.Input[_builtins.str] account_id: Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
27
32
  :param pulumi.Input['AlertChannelConfigArgs'] config: A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
28
- :param pulumi.Input[str] name: The name of the channel.
33
+ :param pulumi.Input[_builtins.str] name: The name of the channel.
29
34
  """
30
35
  pulumi.set(__self__, "type", type)
31
36
  if account_id is not None:
@@ -35,31 +40,31 @@ class AlertChannelArgs:
35
40
  if name is not None:
36
41
  pulumi.set(__self__, "name", name)
37
42
 
38
- @property
43
+ @_builtins.property
39
44
  @pulumi.getter
40
- def type(self) -> pulumi.Input[str]:
45
+ def type(self) -> pulumi.Input[_builtins.str]:
41
46
  """
42
47
  The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
43
48
  """
44
49
  return pulumi.get(self, "type")
45
50
 
46
51
  @type.setter
47
- def type(self, value: pulumi.Input[str]):
52
+ def type(self, value: pulumi.Input[_builtins.str]):
48
53
  pulumi.set(self, "type", value)
49
54
 
50
- @property
55
+ @_builtins.property
51
56
  @pulumi.getter(name="accountId")
52
- def account_id(self) -> Optional[pulumi.Input[int]]:
57
+ def account_id(self) -> Optional[pulumi.Input[_builtins.str]]:
53
58
  """
54
59
  Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
55
60
  """
56
61
  return pulumi.get(self, "account_id")
57
62
 
58
63
  @account_id.setter
59
- def account_id(self, value: Optional[pulumi.Input[int]]):
64
+ def account_id(self, value: Optional[pulumi.Input[_builtins.str]]):
60
65
  pulumi.set(self, "account_id", value)
61
66
 
62
- @property
67
+ @_builtins.property
63
68
  @pulumi.getter
64
69
  def config(self) -> Optional[pulumi.Input['AlertChannelConfigArgs']]:
65
70
  """
@@ -71,32 +76,32 @@ class AlertChannelArgs:
71
76
  def config(self, value: Optional[pulumi.Input['AlertChannelConfigArgs']]):
72
77
  pulumi.set(self, "config", value)
73
78
 
74
- @property
79
+ @_builtins.property
75
80
  @pulumi.getter
76
- def name(self) -> Optional[pulumi.Input[str]]:
81
+ def name(self) -> Optional[pulumi.Input[_builtins.str]]:
77
82
  """
78
83
  The name of the channel.
79
84
  """
80
85
  return pulumi.get(self, "name")
81
86
 
82
87
  @name.setter
83
- def name(self, value: Optional[pulumi.Input[str]]):
88
+ def name(self, value: Optional[pulumi.Input[_builtins.str]]):
84
89
  pulumi.set(self, "name", value)
85
90
 
86
91
 
87
92
  @pulumi.input_type
88
93
  class _AlertChannelState:
89
94
  def __init__(__self__, *,
90
- account_id: Optional[pulumi.Input[int]] = None,
95
+ account_id: Optional[pulumi.Input[_builtins.str]] = None,
91
96
  config: Optional[pulumi.Input['AlertChannelConfigArgs']] = None,
92
- name: Optional[pulumi.Input[str]] = None,
93
- type: Optional[pulumi.Input[str]] = None):
97
+ name: Optional[pulumi.Input[_builtins.str]] = None,
98
+ type: Optional[pulumi.Input[_builtins.str]] = None):
94
99
  """
95
100
  Input properties used for looking up and filtering AlertChannel resources.
96
- :param pulumi.Input[int] account_id: Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
101
+ :param pulumi.Input[_builtins.str] account_id: Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
97
102
  :param pulumi.Input['AlertChannelConfigArgs'] config: A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
98
- :param pulumi.Input[str] name: The name of the channel.
99
- :param pulumi.Input[str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
103
+ :param pulumi.Input[_builtins.str] name: The name of the channel.
104
+ :param pulumi.Input[_builtins.str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
100
105
  """
101
106
  if account_id is not None:
102
107
  pulumi.set(__self__, "account_id", account_id)
@@ -107,19 +112,19 @@ class _AlertChannelState:
107
112
  if type is not None:
108
113
  pulumi.set(__self__, "type", type)
109
114
 
110
- @property
115
+ @_builtins.property
111
116
  @pulumi.getter(name="accountId")
112
- def account_id(self) -> Optional[pulumi.Input[int]]:
117
+ def account_id(self) -> Optional[pulumi.Input[_builtins.str]]:
113
118
  """
114
119
  Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
115
120
  """
116
121
  return pulumi.get(self, "account_id")
117
122
 
118
123
  @account_id.setter
119
- def account_id(self, value: Optional[pulumi.Input[int]]):
124
+ def account_id(self, value: Optional[pulumi.Input[_builtins.str]]):
120
125
  pulumi.set(self, "account_id", value)
121
126
 
122
- @property
127
+ @_builtins.property
123
128
  @pulumi.getter
124
129
  def config(self) -> Optional[pulumi.Input['AlertChannelConfigArgs']]:
125
130
  """
@@ -131,59 +136,63 @@ class _AlertChannelState:
131
136
  def config(self, value: Optional[pulumi.Input['AlertChannelConfigArgs']]):
132
137
  pulumi.set(self, "config", value)
133
138
 
134
- @property
139
+ @_builtins.property
135
140
  @pulumi.getter
136
- def name(self) -> Optional[pulumi.Input[str]]:
141
+ def name(self) -> Optional[pulumi.Input[_builtins.str]]:
137
142
  """
138
143
  The name of the channel.
139
144
  """
140
145
  return pulumi.get(self, "name")
141
146
 
142
147
  @name.setter
143
- def name(self, value: Optional[pulumi.Input[str]]):
148
+ def name(self, value: Optional[pulumi.Input[_builtins.str]]):
144
149
  pulumi.set(self, "name", value)
145
150
 
146
- @property
151
+ @_builtins.property
147
152
  @pulumi.getter
148
- def type(self) -> Optional[pulumi.Input[str]]:
153
+ def type(self) -> Optional[pulumi.Input[_builtins.str]]:
149
154
  """
150
155
  The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
151
156
  """
152
157
  return pulumi.get(self, "type")
153
158
 
154
159
  @type.setter
155
- def type(self, value: Optional[pulumi.Input[str]]):
160
+ def type(self, value: Optional[pulumi.Input[_builtins.str]]):
156
161
  pulumi.set(self, "type", value)
157
162
 
158
163
 
164
+ @pulumi.type_token("newrelic:index/alertChannel:AlertChannel")
159
165
  class AlertChannel(pulumi.CustomResource):
160
166
  @overload
161
167
  def __init__(__self__,
162
168
  resource_name: str,
163
169
  opts: Optional[pulumi.ResourceOptions] = None,
164
- account_id: Optional[pulumi.Input[int]] = None,
165
- config: Optional[pulumi.Input[pulumi.InputType['AlertChannelConfigArgs']]] = None,
166
- name: Optional[pulumi.Input[str]] = None,
167
- type: Optional[pulumi.Input[str]] = None,
170
+ account_id: Optional[pulumi.Input[_builtins.str]] = None,
171
+ config: Optional[pulumi.Input[Union['AlertChannelConfigArgs', 'AlertChannelConfigArgsDict']]] = None,
172
+ name: Optional[pulumi.Input[_builtins.str]] = None,
173
+ type: Optional[pulumi.Input[_builtins.str]] = None,
168
174
  __props__=None):
169
175
  """
170
176
  Use this resource to create and manage New Relic alert channels.
171
177
 
172
- > **WARNING:** The `AlertChannel` resource is deprecated and will be removed in the next major release. For managing channel resources in Workflows, use `NotificationChannel`.
178
+ > **WARNING:** The `AlertChannel` resource is **deprecated** and will be **removed in a future major release**. As an alternative, you can set up channels using a combination of the newer resources `NotificationDestination` and `NotificationChannel`. We **strongly recommend** migrating to these new resources at the earliest. Please refer to this example for a detailed illustration on setting up channels with these resources.
173
179
 
174
180
  ## Example Usage
181
+
175
182
  ### Email
176
183
  ```python
177
184
  import pulumi
178
185
  import pulumi_newrelic as newrelic
179
186
 
180
187
  foo = newrelic.AlertChannel("foo",
181
- config=newrelic.AlertChannelConfigArgs(
182
- include_json_attachment="true",
183
- recipients="foo@example.com",
184
- ),
185
- type="email")
188
+ name="foo",
189
+ type="email",
190
+ config={
191
+ "recipients": "foo@example.com",
192
+ "include_json_attachment": "true",
193
+ })
186
194
  ```
195
+
187
196
  ## Additional Examples
188
197
 
189
198
  ##### Slack
@@ -192,11 +201,12 @@ class AlertChannel(pulumi.CustomResource):
192
201
  import pulumi_newrelic as newrelic
193
202
 
194
203
  foo = newrelic.AlertChannel("foo",
195
- config=newrelic.AlertChannelConfigArgs(
196
- channel="example-alerts-channel",
197
- url="https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX",
198
- ),
199
- type="slack")
204
+ name="slack-example",
205
+ type="slack",
206
+ config={
207
+ "url": "https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX",
208
+ "channel": "example-alerts-channel",
209
+ })
200
210
  ```
201
211
 
202
212
  > **NOTE:** For instructions on setting up Webhooks with Slack, please visit the article linked under the argument `slack` in the aforementioned configuration, or [this article](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts/#slack) in New Relic's docs for additional details on setting up the `New Relic Alerts` Slack application, and subsequently using the generated Webhook URL.
@@ -207,13 +217,14 @@ class AlertChannel(pulumi.CustomResource):
207
217
  import pulumi_newrelic as newrelic
208
218
 
209
219
  foo = newrelic.AlertChannel("foo",
210
- config=newrelic.AlertChannelConfigArgs(
211
- api_key="abc123",
212
- recipients="user1@domain.com, user2@domain.com",
213
- tags="tag1, tag2",
214
- teams="team1, team2",
215
- ),
216
- type="opsgenie")
220
+ name="opsgenie-example",
221
+ type="opsgenie",
222
+ config={
223
+ "api_key": "abc123",
224
+ "teams": "team1, team2",
225
+ "tags": "tag1, tag2",
226
+ "recipients": "user1@domain.com, user2@domain.com",
227
+ })
217
228
  ```
218
229
 
219
230
  ### PagerDuty
@@ -222,10 +233,11 @@ class AlertChannel(pulumi.CustomResource):
222
233
  import pulumi_newrelic as newrelic
223
234
 
224
235
  foo = newrelic.AlertChannel("foo",
225
- config=newrelic.AlertChannelConfigArgs(
226
- service_key="abc123",
227
- ),
228
- type="pagerduty")
236
+ name="pagerduty-example",
237
+ type="pagerduty",
238
+ config={
239
+ "service_key": "abc123",
240
+ })
229
241
  ```
230
242
 
231
243
  ### VictorOps
@@ -234,11 +246,12 @@ class AlertChannel(pulumi.CustomResource):
234
246
  import pulumi_newrelic as newrelic
235
247
 
236
248
  foo = newrelic.AlertChannel("foo",
237
- config=newrelic.AlertChannelConfigArgs(
238
- key="abc123",
239
- route_key="/example",
240
- ),
241
- type="victorops")
249
+ name="victorops-example",
250
+ type="victorops",
251
+ config={
252
+ "key": "abc123",
253
+ "route_key": "/example",
254
+ })
242
255
  ```
243
256
 
244
257
  ### Webhook
@@ -247,19 +260,20 @@ class AlertChannel(pulumi.CustomResource):
247
260
  import pulumi_newrelic as newrelic
248
261
 
249
262
  foo = newrelic.AlertChannel("foo",
263
+ name="webhook-example",
250
264
  type="webhook",
251
- config=newrelic.AlertChannelConfigArgs(
252
- base_url="http://www.test.com",
253
- payload_type="application/json",
254
- payload={
265
+ config={
266
+ "base_url": "http://www.test.com",
267
+ "payload_type": "application/json",
268
+ "payload": {
255
269
  "condition_name": "$CONDITION_NAME",
256
270
  "policy_name": "$POLICY_NAME",
257
271
  },
258
- headers={
272
+ "headers": {
259
273
  "header1": value1,
260
274
  "header2": value2,
261
275
  },
262
- ))
276
+ })
263
277
  ```
264
278
 
265
279
  ### Webhook with complex payload
@@ -268,35 +282,37 @@ class AlertChannel(pulumi.CustomResource):
268
282
  import pulumi_newrelic as newrelic
269
283
 
270
284
  foo = newrelic.AlertChannel("foo",
271
- config=newrelic.AlertChannelConfigArgs(
272
- base_url="http://www.test.com",
273
- payload_string=\"\"\"{
274
- "my_custom_values": {
275
- "condition_name": "$CONDITION_NAME",
276
- "policy_name": "$POLICY_NAME"
285
+ name="webhook-example",
286
+ type="webhook",
287
+ config={
288
+ "base_url": "http://www.test.com",
289
+ "payload_type": "application/json",
290
+ "payload_string": \"\"\"{
291
+ \\"my_custom_values\\": {
292
+ \\"condition_name\\": \\"$CONDITION_NAME\\",
293
+ \\"policy_name\\": \\"$POLICY_NAME\\"
277
294
  }
278
295
  }
279
-
280
296
  \"\"\",
281
- payload_type="application/json",
282
- ),
283
- type="webhook")
297
+ })
284
298
  ```
285
299
 
286
300
  ## Import
287
301
 
288
- Alert channels can be imported using the `id`, e.g. bash
302
+ Alert channels can be imported using the `id`, e.g.
303
+
304
+ bash
289
305
 
290
306
  ```sh
291
- $ pulumi import newrelic:index/alertChannel:AlertChannel main <id>
307
+ $ pulumi import newrelic:index/alertChannel:AlertChannel main <id>
292
308
  ```
293
309
 
294
310
  :param str resource_name: The name of the resource.
295
311
  :param pulumi.ResourceOptions opts: Options for the resource.
296
- :param pulumi.Input[int] account_id: Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
297
- :param pulumi.Input[pulumi.InputType['AlertChannelConfigArgs']] config: A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
298
- :param pulumi.Input[str] name: The name of the channel.
299
- :param pulumi.Input[str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
312
+ :param pulumi.Input[_builtins.str] account_id: Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
313
+ :param pulumi.Input[Union['AlertChannelConfigArgs', 'AlertChannelConfigArgsDict']] config: A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
314
+ :param pulumi.Input[_builtins.str] name: The name of the channel.
315
+ :param pulumi.Input[_builtins.str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
300
316
  """
301
317
  ...
302
318
  @overload
@@ -307,21 +323,24 @@ class AlertChannel(pulumi.CustomResource):
307
323
  """
308
324
  Use this resource to create and manage New Relic alert channels.
309
325
 
310
- > **WARNING:** The `AlertChannel` resource is deprecated and will be removed in the next major release. For managing channel resources in Workflows, use `NotificationChannel`.
326
+ > **WARNING:** The `AlertChannel` resource is **deprecated** and will be **removed in a future major release**. As an alternative, you can set up channels using a combination of the newer resources `NotificationDestination` and `NotificationChannel`. We **strongly recommend** migrating to these new resources at the earliest. Please refer to this example for a detailed illustration on setting up channels with these resources.
311
327
 
312
328
  ## Example Usage
329
+
313
330
  ### Email
314
331
  ```python
315
332
  import pulumi
316
333
  import pulumi_newrelic as newrelic
317
334
 
318
335
  foo = newrelic.AlertChannel("foo",
319
- config=newrelic.AlertChannelConfigArgs(
320
- include_json_attachment="true",
321
- recipients="foo@example.com",
322
- ),
323
- type="email")
336
+ name="foo",
337
+ type="email",
338
+ config={
339
+ "recipients": "foo@example.com",
340
+ "include_json_attachment": "true",
341
+ })
324
342
  ```
343
+
325
344
  ## Additional Examples
326
345
 
327
346
  ##### Slack
@@ -330,11 +349,12 @@ class AlertChannel(pulumi.CustomResource):
330
349
  import pulumi_newrelic as newrelic
331
350
 
332
351
  foo = newrelic.AlertChannel("foo",
333
- config=newrelic.AlertChannelConfigArgs(
334
- channel="example-alerts-channel",
335
- url="https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX",
336
- ),
337
- type="slack")
352
+ name="slack-example",
353
+ type="slack",
354
+ config={
355
+ "url": "https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX",
356
+ "channel": "example-alerts-channel",
357
+ })
338
358
  ```
339
359
 
340
360
  > **NOTE:** For instructions on setting up Webhooks with Slack, please visit the article linked under the argument `slack` in the aforementioned configuration, or [this article](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts/#slack) in New Relic's docs for additional details on setting up the `New Relic Alerts` Slack application, and subsequently using the generated Webhook URL.
@@ -345,13 +365,14 @@ class AlertChannel(pulumi.CustomResource):
345
365
  import pulumi_newrelic as newrelic
346
366
 
347
367
  foo = newrelic.AlertChannel("foo",
348
- config=newrelic.AlertChannelConfigArgs(
349
- api_key="abc123",
350
- recipients="user1@domain.com, user2@domain.com",
351
- tags="tag1, tag2",
352
- teams="team1, team2",
353
- ),
354
- type="opsgenie")
368
+ name="opsgenie-example",
369
+ type="opsgenie",
370
+ config={
371
+ "api_key": "abc123",
372
+ "teams": "team1, team2",
373
+ "tags": "tag1, tag2",
374
+ "recipients": "user1@domain.com, user2@domain.com",
375
+ })
355
376
  ```
356
377
 
357
378
  ### PagerDuty
@@ -360,10 +381,11 @@ class AlertChannel(pulumi.CustomResource):
360
381
  import pulumi_newrelic as newrelic
361
382
 
362
383
  foo = newrelic.AlertChannel("foo",
363
- config=newrelic.AlertChannelConfigArgs(
364
- service_key="abc123",
365
- ),
366
- type="pagerduty")
384
+ name="pagerduty-example",
385
+ type="pagerduty",
386
+ config={
387
+ "service_key": "abc123",
388
+ })
367
389
  ```
368
390
 
369
391
  ### VictorOps
@@ -372,11 +394,12 @@ class AlertChannel(pulumi.CustomResource):
372
394
  import pulumi_newrelic as newrelic
373
395
 
374
396
  foo = newrelic.AlertChannel("foo",
375
- config=newrelic.AlertChannelConfigArgs(
376
- key="abc123",
377
- route_key="/example",
378
- ),
379
- type="victorops")
397
+ name="victorops-example",
398
+ type="victorops",
399
+ config={
400
+ "key": "abc123",
401
+ "route_key": "/example",
402
+ })
380
403
  ```
381
404
 
382
405
  ### Webhook
@@ -385,19 +408,20 @@ class AlertChannel(pulumi.CustomResource):
385
408
  import pulumi_newrelic as newrelic
386
409
 
387
410
  foo = newrelic.AlertChannel("foo",
411
+ name="webhook-example",
388
412
  type="webhook",
389
- config=newrelic.AlertChannelConfigArgs(
390
- base_url="http://www.test.com",
391
- payload_type="application/json",
392
- payload={
413
+ config={
414
+ "base_url": "http://www.test.com",
415
+ "payload_type": "application/json",
416
+ "payload": {
393
417
  "condition_name": "$CONDITION_NAME",
394
418
  "policy_name": "$POLICY_NAME",
395
419
  },
396
- headers={
420
+ "headers": {
397
421
  "header1": value1,
398
422
  "header2": value2,
399
423
  },
400
- ))
424
+ })
401
425
  ```
402
426
 
403
427
  ### Webhook with complex payload
@@ -406,27 +430,29 @@ class AlertChannel(pulumi.CustomResource):
406
430
  import pulumi_newrelic as newrelic
407
431
 
408
432
  foo = newrelic.AlertChannel("foo",
409
- config=newrelic.AlertChannelConfigArgs(
410
- base_url="http://www.test.com",
411
- payload_string=\"\"\"{
412
- "my_custom_values": {
413
- "condition_name": "$CONDITION_NAME",
414
- "policy_name": "$POLICY_NAME"
433
+ name="webhook-example",
434
+ type="webhook",
435
+ config={
436
+ "base_url": "http://www.test.com",
437
+ "payload_type": "application/json",
438
+ "payload_string": \"\"\"{
439
+ \\"my_custom_values\\": {
440
+ \\"condition_name\\": \\"$CONDITION_NAME\\",
441
+ \\"policy_name\\": \\"$POLICY_NAME\\"
415
442
  }
416
443
  }
417
-
418
444
  \"\"\",
419
- payload_type="application/json",
420
- ),
421
- type="webhook")
445
+ })
422
446
  ```
423
447
 
424
448
  ## Import
425
449
 
426
- Alert channels can be imported using the `id`, e.g. bash
450
+ Alert channels can be imported using the `id`, e.g.
451
+
452
+ bash
427
453
 
428
454
  ```sh
429
- $ pulumi import newrelic:index/alertChannel:AlertChannel main <id>
455
+ $ pulumi import newrelic:index/alertChannel:AlertChannel main <id>
430
456
  ```
431
457
 
432
458
  :param str resource_name: The name of the resource.
@@ -444,10 +470,10 @@ class AlertChannel(pulumi.CustomResource):
444
470
  def _internal_init(__self__,
445
471
  resource_name: str,
446
472
  opts: Optional[pulumi.ResourceOptions] = None,
447
- account_id: Optional[pulumi.Input[int]] = None,
448
- config: Optional[pulumi.Input[pulumi.InputType['AlertChannelConfigArgs']]] = None,
449
- name: Optional[pulumi.Input[str]] = None,
450
- type: Optional[pulumi.Input[str]] = None,
473
+ account_id: Optional[pulumi.Input[_builtins.str]] = None,
474
+ config: Optional[pulumi.Input[Union['AlertChannelConfigArgs', 'AlertChannelConfigArgsDict']]] = None,
475
+ name: Optional[pulumi.Input[_builtins.str]] = None,
476
+ type: Optional[pulumi.Input[_builtins.str]] = None,
451
477
  __props__=None):
452
478
  opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
453
479
  if not isinstance(opts, pulumi.ResourceOptions):
@@ -473,10 +499,10 @@ class AlertChannel(pulumi.CustomResource):
473
499
  def get(resource_name: str,
474
500
  id: pulumi.Input[str],
475
501
  opts: Optional[pulumi.ResourceOptions] = None,
476
- account_id: Optional[pulumi.Input[int]] = None,
477
- config: Optional[pulumi.Input[pulumi.InputType['AlertChannelConfigArgs']]] = None,
478
- name: Optional[pulumi.Input[str]] = None,
479
- type: Optional[pulumi.Input[str]] = None) -> 'AlertChannel':
502
+ account_id: Optional[pulumi.Input[_builtins.str]] = None,
503
+ config: Optional[pulumi.Input[Union['AlertChannelConfigArgs', 'AlertChannelConfigArgsDict']]] = None,
504
+ name: Optional[pulumi.Input[_builtins.str]] = None,
505
+ type: Optional[pulumi.Input[_builtins.str]] = None) -> 'AlertChannel':
480
506
  """
481
507
  Get an existing AlertChannel resource's state with the given name, id, and optional extra
482
508
  properties used to qualify the lookup.
@@ -484,10 +510,10 @@ class AlertChannel(pulumi.CustomResource):
484
510
  :param str resource_name: The unique name of the resulting resource.
485
511
  :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
486
512
  :param pulumi.ResourceOptions opts: Options for the resource.
487
- :param pulumi.Input[int] account_id: Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
488
- :param pulumi.Input[pulumi.InputType['AlertChannelConfigArgs']] config: A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
489
- :param pulumi.Input[str] name: The name of the channel.
490
- :param pulumi.Input[str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
513
+ :param pulumi.Input[_builtins.str] account_id: Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
514
+ :param pulumi.Input[Union['AlertChannelConfigArgs', 'AlertChannelConfigArgsDict']] config: A nested block that describes an alert channel configuration. Only one config block is permitted per alert channel definition. See Nested config blocks below for details.
515
+ :param pulumi.Input[_builtins.str] name: The name of the channel.
516
+ :param pulumi.Input[_builtins.str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
491
517
  """
492
518
  opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
493
519
 
@@ -499,15 +525,15 @@ class AlertChannel(pulumi.CustomResource):
499
525
  __props__.__dict__["type"] = type
500
526
  return AlertChannel(resource_name, opts=opts, __props__=__props__)
501
527
 
502
- @property
528
+ @_builtins.property
503
529
  @pulumi.getter(name="accountId")
504
- def account_id(self) -> pulumi.Output[int]:
530
+ def account_id(self) -> pulumi.Output[_builtins.str]:
505
531
  """
506
532
  Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
507
533
  """
508
534
  return pulumi.get(self, "account_id")
509
535
 
510
- @property
536
+ @_builtins.property
511
537
  @pulumi.getter
512
538
  def config(self) -> pulumi.Output[Optional['outputs.AlertChannelConfig']]:
513
539
  """
@@ -515,17 +541,17 @@ class AlertChannel(pulumi.CustomResource):
515
541
  """
516
542
  return pulumi.get(self, "config")
517
543
 
518
- @property
544
+ @_builtins.property
519
545
  @pulumi.getter
520
- def name(self) -> pulumi.Output[str]:
546
+ def name(self) -> pulumi.Output[_builtins.str]:
521
547
  """
522
548
  The name of the channel.
523
549
  """
524
550
  return pulumi.get(self, "name")
525
551
 
526
- @property
552
+ @_builtins.property
527
553
  @pulumi.getter
528
- def type(self) -> pulumi.Output[str]:
554
+ def type(self) -> pulumi.Output[_builtins.str]:
529
555
  """
530
556
  The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
531
557
  """