pulumi-newrelic 5.20.0a1709643785__py3-none-any.whl → 5.39.0a1736834464__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- pulumi_newrelic/__init__.py +9 -0
- pulumi_newrelic/_inputs.py +7153 -461
- pulumi_newrelic/_utilities.py +41 -5
- pulumi_newrelic/account_management.py +13 -4
- pulumi_newrelic/alert_channel.py +122 -101
- pulumi_newrelic/alert_condition.py +120 -109
- pulumi_newrelic/alert_muting_rule.py +130 -74
- pulumi_newrelic/alert_policy.py +88 -67
- pulumi_newrelic/alert_policy_channel.py +81 -68
- pulumi_newrelic/api_access_key.py +49 -52
- pulumi_newrelic/browser_application.py +79 -76
- pulumi_newrelic/cloud/_inputs.py +2527 -1082
- pulumi_newrelic/cloud/aws_govcloud_integrations.py +135 -130
- pulumi_newrelic/cloud/aws_govcloud_link_account.py +25 -18
- pulumi_newrelic/cloud/aws_integrations.py +300 -1324
- pulumi_newrelic/cloud/aws_link_account.py +25 -18
- pulumi_newrelic/cloud/azure_integrations.py +523 -481
- pulumi_newrelic/cloud/azure_link_account.py +36 -29
- pulumi_newrelic/cloud/gcp_integrations.py +343 -320
- pulumi_newrelic/cloud/gcp_link_account.py +25 -18
- pulumi_newrelic/cloud/outputs.py +327 -1072
- pulumi_newrelic/config/__init__.pyi +6 -1
- pulumi_newrelic/config/vars.py +7 -2
- pulumi_newrelic/data_partition_rule.py +23 -16
- pulumi_newrelic/entity_tags.py +36 -31
- pulumi_newrelic/events_to_metrics_rule.py +27 -20
- pulumi_newrelic/get_account.py +24 -12
- pulumi_newrelic/get_alert_channel.py +26 -13
- pulumi_newrelic/get_alert_policy.py +35 -12
- pulumi_newrelic/get_application.py +39 -27
- pulumi_newrelic/get_authentication_domain.py +17 -9
- pulumi_newrelic/get_cloud_account.py +26 -14
- pulumi_newrelic/get_entity.py +90 -85
- pulumi_newrelic/get_group.py +58 -9
- pulumi_newrelic/get_key_transaction.py +109 -30
- pulumi_newrelic/get_notification_destination.py +64 -14
- pulumi_newrelic/get_obfuscation_expression.py +36 -24
- pulumi_newrelic/get_service_level_alert_helper.py +135 -105
- pulumi_newrelic/get_test_grok_pattern.py +29 -14
- pulumi_newrelic/get_user.py +17 -5
- pulumi_newrelic/group.py +5 -132
- pulumi_newrelic/infra_alert_condition.py +157 -140
- pulumi_newrelic/insights/_inputs.py +43 -0
- pulumi_newrelic/insights/event.py +50 -43
- pulumi_newrelic/insights/outputs.py +5 -0
- pulumi_newrelic/key_transaction.py +464 -0
- pulumi_newrelic/log_parsing_rule.py +29 -18
- pulumi_newrelic/monitor_downtime.py +215 -203
- pulumi_newrelic/notification_channel.py +387 -326
- pulumi_newrelic/notification_destination.py +248 -118
- pulumi_newrelic/nrql_alert_condition.py +353 -246
- pulumi_newrelic/nrql_drop_rule.py +57 -30
- pulumi_newrelic/obfuscation_expression.py +25 -18
- pulumi_newrelic/obfuscation_rule.py +40 -31
- pulumi_newrelic/one_dashboard.py +31 -26
- pulumi_newrelic/one_dashboard_json.py +21 -16
- pulumi_newrelic/one_dashboard_raw.py +112 -101
- pulumi_newrelic/outputs.py +2446 -245
- pulumi_newrelic/plugins/_inputs.py +145 -10
- pulumi_newrelic/plugins/application_settings.py +29 -20
- pulumi_newrelic/plugins/outputs.py +15 -10
- pulumi_newrelic/plugins/workload.py +285 -54
- pulumi_newrelic/provider.py +27 -33
- pulumi_newrelic/pulumi-plugin.json +2 -1
- pulumi_newrelic/service_level.py +193 -180
- pulumi_newrelic/synthetics/_inputs.py +159 -2
- pulumi_newrelic/synthetics/alert_condition.py +91 -78
- pulumi_newrelic/synthetics/broken_links_monitor.py +220 -93
- pulumi_newrelic/synthetics/cert_check_monitor.py +223 -94
- pulumi_newrelic/synthetics/get_private_location.py +34 -22
- pulumi_newrelic/synthetics/get_secure_credential.py +24 -12
- pulumi_newrelic/synthetics/monitor.py +352 -179
- pulumi_newrelic/synthetics/multi_location_alert_condition.py +109 -96
- pulumi_newrelic/synthetics/outputs.py +7 -2
- pulumi_newrelic/synthetics/private_location.py +27 -18
- pulumi_newrelic/synthetics/script_monitor.py +321 -168
- pulumi_newrelic/synthetics/secure_credential.py +25 -20
- pulumi_newrelic/synthetics/step_monitor.py +409 -98
- pulumi_newrelic/user.py +13 -6
- pulumi_newrelic/workflow.py +215 -184
- {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/METADATA +7 -6
- pulumi_newrelic-5.39.0a1736834464.dist-info/RECORD +90 -0
- {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/WHEEL +1 -1
- pulumi_newrelic-5.20.0a1709643785.dist-info/RECORD +0 -89
- {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/top_level.txt +0 -0
pulumi_newrelic/_utilities.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
import asyncio
|
7
|
+
import functools
|
7
8
|
import importlib.metadata
|
8
9
|
import importlib.util
|
9
10
|
import inspect
|
@@ -11,14 +12,19 @@ import json
|
|
11
12
|
import os
|
12
13
|
import sys
|
13
14
|
import typing
|
15
|
+
import warnings
|
16
|
+
import base64
|
14
17
|
|
15
18
|
import pulumi
|
16
19
|
import pulumi.runtime
|
17
20
|
from pulumi.runtime.sync_await import _sync_await
|
21
|
+
from pulumi.runtime.proto import resource_pb2
|
18
22
|
|
19
23
|
from semver import VersionInfo as SemverVersion
|
20
24
|
from parver import Version as PEP440Version
|
21
25
|
|
26
|
+
C = typing.TypeVar("C", bound=typing.Callable)
|
27
|
+
|
22
28
|
|
23
29
|
def get_env(*args):
|
24
30
|
for v in args:
|
@@ -96,10 +102,6 @@ def _get_semver_version():
|
|
96
102
|
_version = _get_semver_version()
|
97
103
|
_version_str = str(_version)
|
98
104
|
|
99
|
-
|
100
|
-
def get_version():
|
101
|
-
return _version_str
|
102
|
-
|
103
105
|
def get_resource_opts_defaults() -> pulumi.ResourceOptions:
|
104
106
|
return pulumi.ResourceOptions(
|
105
107
|
version=get_version(),
|
@@ -262,7 +264,7 @@ def call_plain(
|
|
262
264
|
output = pulumi.runtime.call(tok, props, res, typ)
|
263
265
|
|
264
266
|
# Ingoring deps silently. They are typically non-empty, r.f() calls include r as a dependency.
|
265
|
-
result, known, secret, _ = _sync_await(asyncio.
|
267
|
+
result, known, secret, _ = _sync_await(asyncio.create_task(_await_output(output)))
|
266
268
|
|
267
269
|
problem = None
|
268
270
|
if not known:
|
@@ -287,5 +289,39 @@ async def _await_output(o: pulumi.Output[typing.Any]) -> typing.Tuple[object, bo
|
|
287
289
|
await o._resources,
|
288
290
|
)
|
289
291
|
|
292
|
+
|
293
|
+
# This is included to provide an upgrade path for users who are using a version
|
294
|
+
# of the Pulumi SDK (<3.121.0) that does not include the `deprecated` decorator.
|
295
|
+
def deprecated(message: str) -> typing.Callable[[C], C]:
|
296
|
+
"""
|
297
|
+
Decorator to indicate a function is deprecated.
|
298
|
+
|
299
|
+
As well as inserting appropriate statements to indicate that the function is
|
300
|
+
deprecated, this decorator also tags the function with a special attribute
|
301
|
+
so that Pulumi code can detect that it is deprecated and react appropriately
|
302
|
+
in certain situations.
|
303
|
+
|
304
|
+
message is the deprecation message that should be printed if the function is called.
|
305
|
+
"""
|
306
|
+
|
307
|
+
def decorator(fn: C) -> C:
|
308
|
+
if not callable(fn):
|
309
|
+
raise TypeError("Expected fn to be callable")
|
310
|
+
|
311
|
+
@functools.wraps(fn)
|
312
|
+
def deprecated_fn(*args, **kwargs):
|
313
|
+
warnings.warn(message)
|
314
|
+
pulumi.warn(f"{fn.__name__} is deprecated: {message}")
|
315
|
+
|
316
|
+
return fn(*args, **kwargs)
|
317
|
+
|
318
|
+
deprecated_fn.__dict__["_pulumi_deprecated_callable"] = fn
|
319
|
+
return typing.cast(C, deprecated_fn)
|
320
|
+
|
321
|
+
return decorator
|
322
|
+
|
290
323
|
def get_plugin_download_url():
|
291
324
|
return None
|
325
|
+
|
326
|
+
def get_version():
|
327
|
+
return _version_str
|
@@ -4,9 +4,14 @@
|
|
4
4
|
|
5
5
|
import copy
|
6
6
|
import warnings
|
7
|
+
import sys
|
7
8
|
import pulumi
|
8
9
|
import pulumi.runtime
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
11
|
+
if sys.version_info >= (3, 11):
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
13
|
+
else:
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
10
15
|
from . import _utilities
|
11
16
|
|
12
17
|
__all__ = ['AccountManagementArgs', 'AccountManagement']
|
@@ -110,14 +115,16 @@ class AccountManagement(pulumi.CustomResource):
|
|
110
115
|
import pulumi
|
111
116
|
import pulumi_newrelic as newrelic
|
112
117
|
|
113
|
-
foo = newrelic.AccountManagement("foo",
|
118
|
+
foo = newrelic.AccountManagement("foo",
|
119
|
+
name="Test Account Name",
|
120
|
+
region="us01")
|
114
121
|
```
|
115
122
|
|
116
123
|
## Import
|
117
124
|
|
118
125
|
Accounts can be imported using the `id`, e.g.
|
119
126
|
|
120
|
-
|
127
|
+
bash
|
121
128
|
|
122
129
|
```sh
|
123
130
|
$ pulumi import newrelic:index/accountManagement:AccountManagement foo <id>
|
@@ -146,14 +153,16 @@ class AccountManagement(pulumi.CustomResource):
|
|
146
153
|
import pulumi
|
147
154
|
import pulumi_newrelic as newrelic
|
148
155
|
|
149
|
-
foo = newrelic.AccountManagement("foo",
|
156
|
+
foo = newrelic.AccountManagement("foo",
|
157
|
+
name="Test Account Name",
|
158
|
+
region="us01")
|
150
159
|
```
|
151
160
|
|
152
161
|
## Import
|
153
162
|
|
154
163
|
Accounts can be imported using the `id`, e.g.
|
155
164
|
|
156
|
-
|
165
|
+
bash
|
157
166
|
|
158
167
|
```sh
|
159
168
|
$ pulumi import newrelic:index/accountManagement:AccountManagement foo <id>
|
pulumi_newrelic/alert_channel.py
CHANGED
@@ -4,9 +4,14 @@
|
|
4
4
|
|
5
5
|
import copy
|
6
6
|
import warnings
|
7
|
+
import sys
|
7
8
|
import pulumi
|
8
9
|
import pulumi.runtime
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
11
|
+
if sys.version_info >= (3, 11):
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
13
|
+
else:
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
10
15
|
from . import _utilities
|
11
16
|
from . import outputs
|
12
17
|
from ._inputs import *
|
@@ -17,13 +22,13 @@ __all__ = ['AlertChannelArgs', 'AlertChannel']
|
|
17
22
|
class AlertChannelArgs:
|
18
23
|
def __init__(__self__, *,
|
19
24
|
type: pulumi.Input[str],
|
20
|
-
account_id: Optional[pulumi.Input[
|
25
|
+
account_id: Optional[pulumi.Input[str]] = None,
|
21
26
|
config: Optional[pulumi.Input['AlertChannelConfigArgs']] = None,
|
22
27
|
name: Optional[pulumi.Input[str]] = None):
|
23
28
|
"""
|
24
29
|
The set of arguments for constructing a AlertChannel resource.
|
25
30
|
:param pulumi.Input[str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
|
26
|
-
:param pulumi.Input[
|
31
|
+
:param pulumi.Input[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
33
|
:param pulumi.Input[str] name: The name of the channel.
|
29
34
|
"""
|
@@ -49,14 +54,14 @@ class AlertChannelArgs:
|
|
49
54
|
|
50
55
|
@property
|
51
56
|
@pulumi.getter(name="accountId")
|
52
|
-
def account_id(self) -> Optional[pulumi.Input[
|
57
|
+
def account_id(self) -> Optional[pulumi.Input[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[
|
64
|
+
def account_id(self, value: Optional[pulumi.Input[str]]):
|
60
65
|
pulumi.set(self, "account_id", value)
|
61
66
|
|
62
67
|
@property
|
@@ -87,13 +92,13 @@ class AlertChannelArgs:
|
|
87
92
|
@pulumi.input_type
|
88
93
|
class _AlertChannelState:
|
89
94
|
def __init__(__self__, *,
|
90
|
-
account_id: Optional[pulumi.Input[
|
95
|
+
account_id: Optional[pulumi.Input[str]] = None,
|
91
96
|
config: Optional[pulumi.Input['AlertChannelConfigArgs']] = None,
|
92
97
|
name: Optional[pulumi.Input[str]] = None,
|
93
98
|
type: Optional[pulumi.Input[str]] = None):
|
94
99
|
"""
|
95
100
|
Input properties used for looking up and filtering AlertChannel resources.
|
96
|
-
:param pulumi.Input[
|
101
|
+
:param pulumi.Input[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
103
|
:param pulumi.Input[str] name: The name of the channel.
|
99
104
|
:param pulumi.Input[str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
|
@@ -109,14 +114,14 @@ class _AlertChannelState:
|
|
109
114
|
|
110
115
|
@property
|
111
116
|
@pulumi.getter(name="accountId")
|
112
|
-
def account_id(self) -> Optional[pulumi.Input[
|
117
|
+
def account_id(self) -> Optional[pulumi.Input[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[
|
124
|
+
def account_id(self, value: Optional[pulumi.Input[str]]):
|
120
125
|
pulumi.set(self, "account_id", value)
|
121
126
|
|
122
127
|
@property
|
@@ -161,29 +166,32 @@ class AlertChannel(pulumi.CustomResource):
|
|
161
166
|
def __init__(__self__,
|
162
167
|
resource_name: str,
|
163
168
|
opts: Optional[pulumi.ResourceOptions] = None,
|
164
|
-
account_id: Optional[pulumi.Input[
|
165
|
-
config: Optional[pulumi.Input[
|
169
|
+
account_id: Optional[pulumi.Input[str]] = None,
|
170
|
+
config: Optional[pulumi.Input[Union['AlertChannelConfigArgs', 'AlertChannelConfigArgsDict']]] = None,
|
166
171
|
name: Optional[pulumi.Input[str]] = None,
|
167
172
|
type: Optional[pulumi.Input[str]] = None,
|
168
173
|
__props__=None):
|
169
174
|
"""
|
170
175
|
Use this resource to create and manage New Relic alert channels.
|
171
176
|
|
172
|
-
> **WARNING:** The `AlertChannel` resource is deprecated and will be removed in
|
177
|
+
> **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
178
|
|
174
179
|
## Example Usage
|
180
|
+
|
175
181
|
### Email
|
176
182
|
```python
|
177
183
|
import pulumi
|
178
184
|
import pulumi_newrelic as newrelic
|
179
185
|
|
180
186
|
foo = newrelic.AlertChannel("foo",
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
187
|
+
name="foo",
|
188
|
+
type="email",
|
189
|
+
config={
|
190
|
+
"recipients": "foo@example.com",
|
191
|
+
"include_json_attachment": "true",
|
192
|
+
})
|
186
193
|
```
|
194
|
+
|
187
195
|
## Additional Examples
|
188
196
|
|
189
197
|
##### Slack
|
@@ -192,11 +200,12 @@ class AlertChannel(pulumi.CustomResource):
|
|
192
200
|
import pulumi_newrelic as newrelic
|
193
201
|
|
194
202
|
foo = newrelic.AlertChannel("foo",
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
203
|
+
name="slack-example",
|
204
|
+
type="slack",
|
205
|
+
config={
|
206
|
+
"url": "https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX",
|
207
|
+
"channel": "example-alerts-channel",
|
208
|
+
})
|
200
209
|
```
|
201
210
|
|
202
211
|
> **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 +216,14 @@ class AlertChannel(pulumi.CustomResource):
|
|
207
216
|
import pulumi_newrelic as newrelic
|
208
217
|
|
209
218
|
foo = newrelic.AlertChannel("foo",
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
teams
|
215
|
-
|
216
|
-
|
219
|
+
name="opsgenie-example",
|
220
|
+
type="opsgenie",
|
221
|
+
config={
|
222
|
+
"api_key": "abc123",
|
223
|
+
"teams": "team1, team2",
|
224
|
+
"tags": "tag1, tag2",
|
225
|
+
"recipients": "user1@domain.com, user2@domain.com",
|
226
|
+
})
|
217
227
|
```
|
218
228
|
|
219
229
|
### PagerDuty
|
@@ -222,10 +232,11 @@ class AlertChannel(pulumi.CustomResource):
|
|
222
232
|
import pulumi_newrelic as newrelic
|
223
233
|
|
224
234
|
foo = newrelic.AlertChannel("foo",
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
235
|
+
name="pagerduty-example",
|
236
|
+
type="pagerduty",
|
237
|
+
config={
|
238
|
+
"service_key": "abc123",
|
239
|
+
})
|
229
240
|
```
|
230
241
|
|
231
242
|
### VictorOps
|
@@ -234,11 +245,12 @@ class AlertChannel(pulumi.CustomResource):
|
|
234
245
|
import pulumi_newrelic as newrelic
|
235
246
|
|
236
247
|
foo = newrelic.AlertChannel("foo",
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
248
|
+
name="victorops-example",
|
249
|
+
type="victorops",
|
250
|
+
config={
|
251
|
+
"key": "abc123",
|
252
|
+
"route_key": "/example",
|
253
|
+
})
|
242
254
|
```
|
243
255
|
|
244
256
|
### Webhook
|
@@ -247,19 +259,20 @@ class AlertChannel(pulumi.CustomResource):
|
|
247
259
|
import pulumi_newrelic as newrelic
|
248
260
|
|
249
261
|
foo = newrelic.AlertChannel("foo",
|
262
|
+
name="webhook-example",
|
250
263
|
type="webhook",
|
251
|
-
config=
|
252
|
-
base_url
|
253
|
-
payload_type
|
254
|
-
payload
|
264
|
+
config={
|
265
|
+
"base_url": "http://www.test.com",
|
266
|
+
"payload_type": "application/json",
|
267
|
+
"payload": {
|
255
268
|
"condition_name": "$CONDITION_NAME",
|
256
269
|
"policy_name": "$POLICY_NAME",
|
257
270
|
},
|
258
|
-
headers
|
271
|
+
"headers": {
|
259
272
|
"header1": value1,
|
260
273
|
"header2": value2,
|
261
274
|
},
|
262
|
-
)
|
275
|
+
})
|
263
276
|
```
|
264
277
|
|
265
278
|
### Webhook with complex payload
|
@@ -268,26 +281,26 @@ class AlertChannel(pulumi.CustomResource):
|
|
268
281
|
import pulumi_newrelic as newrelic
|
269
282
|
|
270
283
|
foo = newrelic.AlertChannel("foo",
|
271
|
-
|
272
|
-
|
273
|
-
|
284
|
+
name="webhook-example",
|
285
|
+
type="webhook",
|
286
|
+
config={
|
287
|
+
"base_url": "http://www.test.com",
|
288
|
+
"payload_type": "application/json",
|
289
|
+
"payload_string": \"\"\"{
|
274
290
|
"my_custom_values": {
|
275
291
|
"condition_name": "$CONDITION_NAME",
|
276
292
|
"policy_name": "$POLICY_NAME"
|
277
293
|
}
|
278
294
|
}
|
279
|
-
|
280
295
|
\"\"\",
|
281
|
-
|
282
|
-
),
|
283
|
-
type="webhook")
|
296
|
+
})
|
284
297
|
```
|
285
298
|
|
286
299
|
## Import
|
287
300
|
|
288
301
|
Alert channels can be imported using the `id`, e.g.
|
289
302
|
|
290
|
-
|
303
|
+
bash
|
291
304
|
|
292
305
|
```sh
|
293
306
|
$ pulumi import newrelic:index/alertChannel:AlertChannel main <id>
|
@@ -295,8 +308,8 @@ class AlertChannel(pulumi.CustomResource):
|
|
295
308
|
|
296
309
|
:param str resource_name: The name of the resource.
|
297
310
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
298
|
-
:param pulumi.Input[
|
299
|
-
:param pulumi.Input[
|
311
|
+
:param pulumi.Input[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.
|
312
|
+
: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.
|
300
313
|
:param pulumi.Input[str] name: The name of the channel.
|
301
314
|
:param pulumi.Input[str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
|
302
315
|
"""
|
@@ -309,21 +322,24 @@ class AlertChannel(pulumi.CustomResource):
|
|
309
322
|
"""
|
310
323
|
Use this resource to create and manage New Relic alert channels.
|
311
324
|
|
312
|
-
> **WARNING:** The `AlertChannel` resource is deprecated and will be removed in
|
325
|
+
> **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.
|
313
326
|
|
314
327
|
## Example Usage
|
328
|
+
|
315
329
|
### Email
|
316
330
|
```python
|
317
331
|
import pulumi
|
318
332
|
import pulumi_newrelic as newrelic
|
319
333
|
|
320
334
|
foo = newrelic.AlertChannel("foo",
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
335
|
+
name="foo",
|
336
|
+
type="email",
|
337
|
+
config={
|
338
|
+
"recipients": "foo@example.com",
|
339
|
+
"include_json_attachment": "true",
|
340
|
+
})
|
326
341
|
```
|
342
|
+
|
327
343
|
## Additional Examples
|
328
344
|
|
329
345
|
##### Slack
|
@@ -332,11 +348,12 @@ class AlertChannel(pulumi.CustomResource):
|
|
332
348
|
import pulumi_newrelic as newrelic
|
333
349
|
|
334
350
|
foo = newrelic.AlertChannel("foo",
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
351
|
+
name="slack-example",
|
352
|
+
type="slack",
|
353
|
+
config={
|
354
|
+
"url": "https://hooks.slack.com/services/XXXXXXX/XXXXXXX/XXXXXXXXXX",
|
355
|
+
"channel": "example-alerts-channel",
|
356
|
+
})
|
340
357
|
```
|
341
358
|
|
342
359
|
> **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.
|
@@ -347,13 +364,14 @@ class AlertChannel(pulumi.CustomResource):
|
|
347
364
|
import pulumi_newrelic as newrelic
|
348
365
|
|
349
366
|
foo = newrelic.AlertChannel("foo",
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
teams
|
355
|
-
|
356
|
-
|
367
|
+
name="opsgenie-example",
|
368
|
+
type="opsgenie",
|
369
|
+
config={
|
370
|
+
"api_key": "abc123",
|
371
|
+
"teams": "team1, team2",
|
372
|
+
"tags": "tag1, tag2",
|
373
|
+
"recipients": "user1@domain.com, user2@domain.com",
|
374
|
+
})
|
357
375
|
```
|
358
376
|
|
359
377
|
### PagerDuty
|
@@ -362,10 +380,11 @@ class AlertChannel(pulumi.CustomResource):
|
|
362
380
|
import pulumi_newrelic as newrelic
|
363
381
|
|
364
382
|
foo = newrelic.AlertChannel("foo",
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
383
|
+
name="pagerduty-example",
|
384
|
+
type="pagerduty",
|
385
|
+
config={
|
386
|
+
"service_key": "abc123",
|
387
|
+
})
|
369
388
|
```
|
370
389
|
|
371
390
|
### VictorOps
|
@@ -374,11 +393,12 @@ class AlertChannel(pulumi.CustomResource):
|
|
374
393
|
import pulumi_newrelic as newrelic
|
375
394
|
|
376
395
|
foo = newrelic.AlertChannel("foo",
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
396
|
+
name="victorops-example",
|
397
|
+
type="victorops",
|
398
|
+
config={
|
399
|
+
"key": "abc123",
|
400
|
+
"route_key": "/example",
|
401
|
+
})
|
382
402
|
```
|
383
403
|
|
384
404
|
### Webhook
|
@@ -387,19 +407,20 @@ class AlertChannel(pulumi.CustomResource):
|
|
387
407
|
import pulumi_newrelic as newrelic
|
388
408
|
|
389
409
|
foo = newrelic.AlertChannel("foo",
|
410
|
+
name="webhook-example",
|
390
411
|
type="webhook",
|
391
|
-
config=
|
392
|
-
base_url
|
393
|
-
payload_type
|
394
|
-
payload
|
412
|
+
config={
|
413
|
+
"base_url": "http://www.test.com",
|
414
|
+
"payload_type": "application/json",
|
415
|
+
"payload": {
|
395
416
|
"condition_name": "$CONDITION_NAME",
|
396
417
|
"policy_name": "$POLICY_NAME",
|
397
418
|
},
|
398
|
-
headers
|
419
|
+
"headers": {
|
399
420
|
"header1": value1,
|
400
421
|
"header2": value2,
|
401
422
|
},
|
402
|
-
)
|
423
|
+
})
|
403
424
|
```
|
404
425
|
|
405
426
|
### Webhook with complex payload
|
@@ -408,26 +429,26 @@ class AlertChannel(pulumi.CustomResource):
|
|
408
429
|
import pulumi_newrelic as newrelic
|
409
430
|
|
410
431
|
foo = newrelic.AlertChannel("foo",
|
411
|
-
|
412
|
-
|
413
|
-
|
432
|
+
name="webhook-example",
|
433
|
+
type="webhook",
|
434
|
+
config={
|
435
|
+
"base_url": "http://www.test.com",
|
436
|
+
"payload_type": "application/json",
|
437
|
+
"payload_string": \"\"\"{
|
414
438
|
"my_custom_values": {
|
415
439
|
"condition_name": "$CONDITION_NAME",
|
416
440
|
"policy_name": "$POLICY_NAME"
|
417
441
|
}
|
418
442
|
}
|
419
|
-
|
420
443
|
\"\"\",
|
421
|
-
|
422
|
-
),
|
423
|
-
type="webhook")
|
444
|
+
})
|
424
445
|
```
|
425
446
|
|
426
447
|
## Import
|
427
448
|
|
428
449
|
Alert channels can be imported using the `id`, e.g.
|
429
450
|
|
430
|
-
|
451
|
+
bash
|
431
452
|
|
432
453
|
```sh
|
433
454
|
$ pulumi import newrelic:index/alertChannel:AlertChannel main <id>
|
@@ -448,8 +469,8 @@ class AlertChannel(pulumi.CustomResource):
|
|
448
469
|
def _internal_init(__self__,
|
449
470
|
resource_name: str,
|
450
471
|
opts: Optional[pulumi.ResourceOptions] = None,
|
451
|
-
account_id: Optional[pulumi.Input[
|
452
|
-
config: Optional[pulumi.Input[
|
472
|
+
account_id: Optional[pulumi.Input[str]] = None,
|
473
|
+
config: Optional[pulumi.Input[Union['AlertChannelConfigArgs', 'AlertChannelConfigArgsDict']]] = None,
|
453
474
|
name: Optional[pulumi.Input[str]] = None,
|
454
475
|
type: Optional[pulumi.Input[str]] = None,
|
455
476
|
__props__=None):
|
@@ -477,8 +498,8 @@ class AlertChannel(pulumi.CustomResource):
|
|
477
498
|
def get(resource_name: str,
|
478
499
|
id: pulumi.Input[str],
|
479
500
|
opts: Optional[pulumi.ResourceOptions] = None,
|
480
|
-
account_id: Optional[pulumi.Input[
|
481
|
-
config: Optional[pulumi.Input[
|
501
|
+
account_id: Optional[pulumi.Input[str]] = None,
|
502
|
+
config: Optional[pulumi.Input[Union['AlertChannelConfigArgs', 'AlertChannelConfigArgsDict']]] = None,
|
482
503
|
name: Optional[pulumi.Input[str]] = None,
|
483
504
|
type: Optional[pulumi.Input[str]] = None) -> 'AlertChannel':
|
484
505
|
"""
|
@@ -488,8 +509,8 @@ class AlertChannel(pulumi.CustomResource):
|
|
488
509
|
:param str resource_name: The unique name of the resulting resource.
|
489
510
|
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
|
490
511
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
491
|
-
:param pulumi.Input[
|
492
|
-
:param pulumi.Input[
|
512
|
+
:param pulumi.Input[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.
|
513
|
+
: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.
|
493
514
|
:param pulumi.Input[str] name: The name of the channel.
|
494
515
|
:param pulumi.Input[str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
|
495
516
|
"""
|
@@ -505,7 +526,7 @@ class AlertChannel(pulumi.CustomResource):
|
|
505
526
|
|
506
527
|
@property
|
507
528
|
@pulumi.getter(name="accountId")
|
508
|
-
def account_id(self) -> pulumi.Output[
|
529
|
+
def account_id(self) -> pulumi.Output[str]:
|
509
530
|
"""
|
510
531
|
Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
|
511
532
|
"""
|