pulumi-newrelic 5.21.0a1710157101__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 +11 -6
- pulumi_newrelic/alert_channel.py +116 -127
- pulumi_newrelic/alert_condition.py +116 -129
- pulumi_newrelic/alert_muting_rule.py +128 -76
- pulumi_newrelic/alert_policy.py +78 -75
- pulumi_newrelic/alert_policy_channel.py +77 -68
- pulumi_newrelic/api_access_key.py +45 -28
- pulumi_newrelic/browser_application.py +77 -78
- pulumi_newrelic/cloud/_inputs.py +2527 -1082
- pulumi_newrelic/cloud/aws_govcloud_integrations.py +133 -128
- pulumi_newrelic/cloud/aws_govcloud_link_account.py +23 -20
- pulumi_newrelic/cloud/aws_integrations.py +298 -1326
- pulumi_newrelic/cloud/aws_link_account.py +23 -20
- pulumi_newrelic/cloud/azure_integrations.py +521 -483
- pulumi_newrelic/cloud/azure_link_account.py +34 -31
- pulumi_newrelic/cloud/gcp_integrations.py +341 -322
- pulumi_newrelic/cloud/gcp_link_account.py +23 -20
- 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 +19 -18
- pulumi_newrelic/entity_tags.py +32 -31
- pulumi_newrelic/events_to_metrics_rule.py +23 -20
- pulumi_newrelic/get_account.py +24 -16
- pulumi_newrelic/get_alert_channel.py +26 -13
- pulumi_newrelic/get_alert_policy.py +35 -12
- pulumi_newrelic/get_application.py +39 -31
- pulumi_newrelic/get_authentication_domain.py +17 -13
- pulumi_newrelic/get_cloud_account.py +26 -18
- pulumi_newrelic/get_entity.py +90 -147
- pulumi_newrelic/get_group.py +58 -13
- pulumi_newrelic/get_key_transaction.py +109 -34
- pulumi_newrelic/get_notification_destination.py +64 -14
- pulumi_newrelic/get_obfuscation_expression.py +36 -28
- pulumi_newrelic/get_service_level_alert_helper.py +135 -117
- pulumi_newrelic/get_test_grok_pattern.py +29 -18
- pulumi_newrelic/get_user.py +17 -9
- pulumi_newrelic/group.py +5 -146
- pulumi_newrelic/infra_alert_condition.py +160 -167
- pulumi_newrelic/insights/_inputs.py +43 -0
- pulumi_newrelic/insights/event.py +48 -47
- pulumi_newrelic/insights/outputs.py +5 -0
- pulumi_newrelic/key_transaction.py +464 -0
- pulumi_newrelic/log_parsing_rule.py +25 -24
- pulumi_newrelic/monitor_downtime.py +211 -225
- pulumi_newrelic/notification_channel.py +381 -366
- pulumi_newrelic/notification_destination.py +192 -54
- pulumi_newrelic/nrql_alert_condition.py +345 -262
- pulumi_newrelic/nrql_drop_rule.py +31 -30
- pulumi_newrelic/obfuscation_expression.py +23 -20
- pulumi_newrelic/obfuscation_rule.py +38 -33
- pulumi_newrelic/one_dashboard.py +29 -24
- pulumi_newrelic/one_dashboard_json.py +19 -14
- pulumi_newrelic/one_dashboard_raw.py +110 -105
- pulumi_newrelic/outputs.py +2446 -245
- pulumi_newrelic/plugins/_inputs.py +145 -10
- pulumi_newrelic/plugins/application_settings.py +25 -36
- pulumi_newrelic/plugins/outputs.py +15 -10
- pulumi_newrelic/plugins/workload.py +215 -92
- pulumi_newrelic/provider.py +27 -33
- pulumi_newrelic/pulumi-plugin.json +2 -1
- pulumi_newrelic/service_level.py +185 -186
- pulumi_newrelic/synthetics/_inputs.py +159 -2
- pulumi_newrelic/synthetics/alert_condition.py +87 -98
- pulumi_newrelic/synthetics/broken_links_monitor.py +216 -99
- pulumi_newrelic/synthetics/cert_check_monitor.py +219 -100
- pulumi_newrelic/synthetics/get_private_location.py +34 -30
- pulumi_newrelic/synthetics/get_secure_credential.py +24 -16
- pulumi_newrelic/synthetics/monitor.py +348 -193
- pulumi_newrelic/synthetics/multi_location_alert_condition.py +105 -100
- pulumi_newrelic/synthetics/outputs.py +7 -2
- pulumi_newrelic/synthetics/private_location.py +25 -20
- pulumi_newrelic/synthetics/script_monitor.py +317 -182
- pulumi_newrelic/synthetics/secure_credential.py +23 -22
- pulumi_newrelic/synthetics/step_monitor.py +405 -100
- pulumi_newrelic/user.py +13 -10
- pulumi_newrelic/workflow.py +209 -196
- {pulumi_newrelic-5.21.0a1710157101.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.21.0a1710157101.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/WHEEL +1 -1
- pulumi_newrelic-5.21.0a1710157101.dist-info/RECORD +0 -89
- {pulumi_newrelic-5.21.0a1710157101.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']
|
@@ -106,14 +111,14 @@ class AccountManagement(pulumi.CustomResource):
|
|
106
111
|
## Example Usage
|
107
112
|
|
108
113
|
##### Create Account
|
109
|
-
<!--Start PulumiCodeChooser -->
|
110
114
|
```python
|
111
115
|
import pulumi
|
112
116
|
import pulumi_newrelic as newrelic
|
113
117
|
|
114
|
-
foo = newrelic.AccountManagement("foo",
|
118
|
+
foo = newrelic.AccountManagement("foo",
|
119
|
+
name="Test Account Name",
|
120
|
+
region="us01")
|
115
121
|
```
|
116
|
-
<!--End PulumiCodeChooser -->
|
117
122
|
|
118
123
|
## Import
|
119
124
|
|
@@ -144,14 +149,14 @@ class AccountManagement(pulumi.CustomResource):
|
|
144
149
|
## Example Usage
|
145
150
|
|
146
151
|
##### Create Account
|
147
|
-
<!--Start PulumiCodeChooser -->
|
148
152
|
```python
|
149
153
|
import pulumi
|
150
154
|
import pulumi_newrelic as newrelic
|
151
155
|
|
152
|
-
foo = newrelic.AccountManagement("foo",
|
156
|
+
foo = newrelic.AccountManagement("foo",
|
157
|
+
name="Test Account Name",
|
158
|
+
region="us01")
|
153
159
|
```
|
154
|
-
<!--End PulumiCodeChooser -->
|
155
160
|
|
156
161
|
## Import
|
157
162
|
|
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,143 +166,135 @@ 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
|
175
180
|
|
176
181
|
### Email
|
177
|
-
<!--Start PulumiCodeChooser -->
|
178
182
|
```python
|
179
183
|
import pulumi
|
180
184
|
import pulumi_newrelic as newrelic
|
181
185
|
|
182
186
|
foo = newrelic.AlertChannel("foo",
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
187
|
+
name="foo",
|
188
|
+
type="email",
|
189
|
+
config={
|
190
|
+
"recipients": "foo@example.com",
|
191
|
+
"include_json_attachment": "true",
|
192
|
+
})
|
188
193
|
```
|
189
|
-
<!--End PulumiCodeChooser -->
|
190
194
|
|
191
195
|
## Additional Examples
|
192
196
|
|
193
197
|
##### Slack
|
194
|
-
<!--Start PulumiCodeChooser -->
|
195
198
|
```python
|
196
199
|
import pulumi
|
197
200
|
import pulumi_newrelic as newrelic
|
198
201
|
|
199
202
|
foo = newrelic.AlertChannel("foo",
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
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
|
+
})
|
205
209
|
```
|
206
|
-
<!--End PulumiCodeChooser -->
|
207
210
|
|
208
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.
|
209
212
|
|
210
213
|
### OpsGenie
|
211
|
-
<!--Start PulumiCodeChooser -->
|
212
214
|
```python
|
213
215
|
import pulumi
|
214
216
|
import pulumi_newrelic as newrelic
|
215
217
|
|
216
218
|
foo = newrelic.AlertChannel("foo",
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
teams
|
222
|
-
|
223
|
-
|
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
|
+
})
|
224
227
|
```
|
225
|
-
<!--End PulumiCodeChooser -->
|
226
228
|
|
227
229
|
### PagerDuty
|
228
|
-
<!--Start PulumiCodeChooser -->
|
229
230
|
```python
|
230
231
|
import pulumi
|
231
232
|
import pulumi_newrelic as newrelic
|
232
233
|
|
233
234
|
foo = newrelic.AlertChannel("foo",
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
235
|
+
name="pagerduty-example",
|
236
|
+
type="pagerduty",
|
237
|
+
config={
|
238
|
+
"service_key": "abc123",
|
239
|
+
})
|
238
240
|
```
|
239
|
-
<!--End PulumiCodeChooser -->
|
240
241
|
|
241
242
|
### VictorOps
|
242
|
-
<!--Start PulumiCodeChooser -->
|
243
243
|
```python
|
244
244
|
import pulumi
|
245
245
|
import pulumi_newrelic as newrelic
|
246
246
|
|
247
247
|
foo = newrelic.AlertChannel("foo",
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
248
|
+
name="victorops-example",
|
249
|
+
type="victorops",
|
250
|
+
config={
|
251
|
+
"key": "abc123",
|
252
|
+
"route_key": "/example",
|
253
|
+
})
|
253
254
|
```
|
254
|
-
<!--End PulumiCodeChooser -->
|
255
255
|
|
256
256
|
### Webhook
|
257
|
-
<!--Start PulumiCodeChooser -->
|
258
257
|
```python
|
259
258
|
import pulumi
|
260
259
|
import pulumi_newrelic as newrelic
|
261
260
|
|
262
261
|
foo = newrelic.AlertChannel("foo",
|
262
|
+
name="webhook-example",
|
263
263
|
type="webhook",
|
264
|
-
config=
|
265
|
-
base_url
|
266
|
-
payload_type
|
267
|
-
payload
|
264
|
+
config={
|
265
|
+
"base_url": "http://www.test.com",
|
266
|
+
"payload_type": "application/json",
|
267
|
+
"payload": {
|
268
268
|
"condition_name": "$CONDITION_NAME",
|
269
269
|
"policy_name": "$POLICY_NAME",
|
270
270
|
},
|
271
|
-
headers
|
271
|
+
"headers": {
|
272
272
|
"header1": value1,
|
273
273
|
"header2": value2,
|
274
274
|
},
|
275
|
-
)
|
275
|
+
})
|
276
276
|
```
|
277
|
-
<!--End PulumiCodeChooser -->
|
278
277
|
|
279
278
|
### Webhook with complex payload
|
280
|
-
<!--Start PulumiCodeChooser -->
|
281
279
|
```python
|
282
280
|
import pulumi
|
283
281
|
import pulumi_newrelic as newrelic
|
284
282
|
|
285
283
|
foo = newrelic.AlertChannel("foo",
|
286
|
-
|
287
|
-
|
288
|
-
|
284
|
+
name="webhook-example",
|
285
|
+
type="webhook",
|
286
|
+
config={
|
287
|
+
"base_url": "http://www.test.com",
|
288
|
+
"payload_type": "application/json",
|
289
|
+
"payload_string": \"\"\"{
|
289
290
|
"my_custom_values": {
|
290
291
|
"condition_name": "$CONDITION_NAME",
|
291
292
|
"policy_name": "$POLICY_NAME"
|
292
293
|
}
|
293
294
|
}
|
294
|
-
|
295
295
|
\"\"\",
|
296
|
-
|
297
|
-
),
|
298
|
-
type="webhook")
|
296
|
+
})
|
299
297
|
```
|
300
|
-
<!--End PulumiCodeChooser -->
|
301
298
|
|
302
299
|
## Import
|
303
300
|
|
@@ -311,8 +308,8 @@ class AlertChannel(pulumi.CustomResource):
|
|
311
308
|
|
312
309
|
:param str resource_name: The name of the resource.
|
313
310
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
314
|
-
:param pulumi.Input[
|
315
|
-
: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.
|
316
313
|
:param pulumi.Input[str] name: The name of the channel.
|
317
314
|
:param pulumi.Input[str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
|
318
315
|
"""
|
@@ -325,135 +322,127 @@ class AlertChannel(pulumi.CustomResource):
|
|
325
322
|
"""
|
326
323
|
Use this resource to create and manage New Relic alert channels.
|
327
324
|
|
328
|
-
> **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.
|
329
326
|
|
330
327
|
## Example Usage
|
331
328
|
|
332
329
|
### Email
|
333
|
-
<!--Start PulumiCodeChooser -->
|
334
330
|
```python
|
335
331
|
import pulumi
|
336
332
|
import pulumi_newrelic as newrelic
|
337
333
|
|
338
334
|
foo = newrelic.AlertChannel("foo",
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
335
|
+
name="foo",
|
336
|
+
type="email",
|
337
|
+
config={
|
338
|
+
"recipients": "foo@example.com",
|
339
|
+
"include_json_attachment": "true",
|
340
|
+
})
|
344
341
|
```
|
345
|
-
<!--End PulumiCodeChooser -->
|
346
342
|
|
347
343
|
## Additional Examples
|
348
344
|
|
349
345
|
##### Slack
|
350
|
-
<!--Start PulumiCodeChooser -->
|
351
346
|
```python
|
352
347
|
import pulumi
|
353
348
|
import pulumi_newrelic as newrelic
|
354
349
|
|
355
350
|
foo = newrelic.AlertChannel("foo",
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
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
|
+
})
|
361
357
|
```
|
362
|
-
<!--End PulumiCodeChooser -->
|
363
358
|
|
364
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.
|
365
360
|
|
366
361
|
### OpsGenie
|
367
|
-
<!--Start PulumiCodeChooser -->
|
368
362
|
```python
|
369
363
|
import pulumi
|
370
364
|
import pulumi_newrelic as newrelic
|
371
365
|
|
372
366
|
foo = newrelic.AlertChannel("foo",
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
teams
|
378
|
-
|
379
|
-
|
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
|
+
})
|
380
375
|
```
|
381
|
-
<!--End PulumiCodeChooser -->
|
382
376
|
|
383
377
|
### PagerDuty
|
384
|
-
<!--Start PulumiCodeChooser -->
|
385
378
|
```python
|
386
379
|
import pulumi
|
387
380
|
import pulumi_newrelic as newrelic
|
388
381
|
|
389
382
|
foo = newrelic.AlertChannel("foo",
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
383
|
+
name="pagerduty-example",
|
384
|
+
type="pagerduty",
|
385
|
+
config={
|
386
|
+
"service_key": "abc123",
|
387
|
+
})
|
394
388
|
```
|
395
|
-
<!--End PulumiCodeChooser -->
|
396
389
|
|
397
390
|
### VictorOps
|
398
|
-
<!--Start PulumiCodeChooser -->
|
399
391
|
```python
|
400
392
|
import pulumi
|
401
393
|
import pulumi_newrelic as newrelic
|
402
394
|
|
403
395
|
foo = newrelic.AlertChannel("foo",
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
396
|
+
name="victorops-example",
|
397
|
+
type="victorops",
|
398
|
+
config={
|
399
|
+
"key": "abc123",
|
400
|
+
"route_key": "/example",
|
401
|
+
})
|
409
402
|
```
|
410
|
-
<!--End PulumiCodeChooser -->
|
411
403
|
|
412
404
|
### Webhook
|
413
|
-
<!--Start PulumiCodeChooser -->
|
414
405
|
```python
|
415
406
|
import pulumi
|
416
407
|
import pulumi_newrelic as newrelic
|
417
408
|
|
418
409
|
foo = newrelic.AlertChannel("foo",
|
410
|
+
name="webhook-example",
|
419
411
|
type="webhook",
|
420
|
-
config=
|
421
|
-
base_url
|
422
|
-
payload_type
|
423
|
-
payload
|
412
|
+
config={
|
413
|
+
"base_url": "http://www.test.com",
|
414
|
+
"payload_type": "application/json",
|
415
|
+
"payload": {
|
424
416
|
"condition_name": "$CONDITION_NAME",
|
425
417
|
"policy_name": "$POLICY_NAME",
|
426
418
|
},
|
427
|
-
headers
|
419
|
+
"headers": {
|
428
420
|
"header1": value1,
|
429
421
|
"header2": value2,
|
430
422
|
},
|
431
|
-
)
|
423
|
+
})
|
432
424
|
```
|
433
|
-
<!--End PulumiCodeChooser -->
|
434
425
|
|
435
426
|
### Webhook with complex payload
|
436
|
-
<!--Start PulumiCodeChooser -->
|
437
427
|
```python
|
438
428
|
import pulumi
|
439
429
|
import pulumi_newrelic as newrelic
|
440
430
|
|
441
431
|
foo = newrelic.AlertChannel("foo",
|
442
|
-
|
443
|
-
|
444
|
-
|
432
|
+
name="webhook-example",
|
433
|
+
type="webhook",
|
434
|
+
config={
|
435
|
+
"base_url": "http://www.test.com",
|
436
|
+
"payload_type": "application/json",
|
437
|
+
"payload_string": \"\"\"{
|
445
438
|
"my_custom_values": {
|
446
439
|
"condition_name": "$CONDITION_NAME",
|
447
440
|
"policy_name": "$POLICY_NAME"
|
448
441
|
}
|
449
442
|
}
|
450
|
-
|
451
443
|
\"\"\",
|
452
|
-
|
453
|
-
),
|
454
|
-
type="webhook")
|
444
|
+
})
|
455
445
|
```
|
456
|
-
<!--End PulumiCodeChooser -->
|
457
446
|
|
458
447
|
## Import
|
459
448
|
|
@@ -480,8 +469,8 @@ class AlertChannel(pulumi.CustomResource):
|
|
480
469
|
def _internal_init(__self__,
|
481
470
|
resource_name: str,
|
482
471
|
opts: Optional[pulumi.ResourceOptions] = None,
|
483
|
-
account_id: Optional[pulumi.Input[
|
484
|
-
config: Optional[pulumi.Input[
|
472
|
+
account_id: Optional[pulumi.Input[str]] = None,
|
473
|
+
config: Optional[pulumi.Input[Union['AlertChannelConfigArgs', 'AlertChannelConfigArgsDict']]] = None,
|
485
474
|
name: Optional[pulumi.Input[str]] = None,
|
486
475
|
type: Optional[pulumi.Input[str]] = None,
|
487
476
|
__props__=None):
|
@@ -509,8 +498,8 @@ class AlertChannel(pulumi.CustomResource):
|
|
509
498
|
def get(resource_name: str,
|
510
499
|
id: pulumi.Input[str],
|
511
500
|
opts: Optional[pulumi.ResourceOptions] = None,
|
512
|
-
account_id: Optional[pulumi.Input[
|
513
|
-
config: Optional[pulumi.Input[
|
501
|
+
account_id: Optional[pulumi.Input[str]] = None,
|
502
|
+
config: Optional[pulumi.Input[Union['AlertChannelConfigArgs', 'AlertChannelConfigArgsDict']]] = None,
|
514
503
|
name: Optional[pulumi.Input[str]] = None,
|
515
504
|
type: Optional[pulumi.Input[str]] = None) -> 'AlertChannel':
|
516
505
|
"""
|
@@ -520,8 +509,8 @@ class AlertChannel(pulumi.CustomResource):
|
|
520
509
|
:param str resource_name: The unique name of the resulting resource.
|
521
510
|
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
|
522
511
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
523
|
-
:param pulumi.Input[
|
524
|
-
: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.
|
525
514
|
:param pulumi.Input[str] name: The name of the channel.
|
526
515
|
:param pulumi.Input[str] type: The type of channel. One of: `email`, `slack`, `opsgenie`, `pagerduty`, `victorops`, or `webhook`.
|
527
516
|
"""
|
@@ -537,7 +526,7 @@ class AlertChannel(pulumi.CustomResource):
|
|
537
526
|
|
538
527
|
@property
|
539
528
|
@pulumi.getter(name="accountId")
|
540
|
-
def account_id(self) -> pulumi.Output[
|
529
|
+
def account_id(self) -> pulumi.Output[str]:
|
541
530
|
"""
|
542
531
|
Determines the New Relic account where the alert channel will be created. Defaults to the account associated with the API key used.
|
543
532
|
"""
|