pulumi-newrelic 5.19.0a1708065288__py3-none-any.whl → 5.20.0__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.
@@ -0,0 +1,412 @@
1
+ # coding=utf-8
2
+ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
3
+ # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+
5
+ import copy
6
+ import warnings
7
+ import pulumi
8
+ import pulumi.runtime
9
+ from typing import Any, Mapping, Optional, Sequence, Union, overload
10
+ from . import _utilities
11
+
12
+ __all__ = ['GroupArgs', 'Group']
13
+
14
+ @pulumi.input_type
15
+ class GroupArgs:
16
+ def __init__(__self__, *,
17
+ authentication_domain_id: pulumi.Input[str],
18
+ name: Optional[pulumi.Input[str]] = None,
19
+ user_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
20
+ """
21
+ The set of arguments for constructing a Group resource.
22
+ :param pulumi.Input[str] authentication_domain_id: The ID of the authentication domain to which the group to be created would belong.
23
+ :param pulumi.Input[str] name: The name of the group to be created.
24
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] user_ids: A list of IDs of users to be included in the group to be created.
25
+
26
+ > **NOTE** The ID of an authentication domain can be retrieved using its name, via the data source `get_authentication_domain`, as shown in the example above. Head over to the documentation of this data source for more details and examples.
27
+
28
+ > **WARNING:** Changing the `authentication_domain_id` of a `Group` resource that has already been applied would result in a **replacement** of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the `authentication_domain_id` of an existing group is not supported.
29
+ """
30
+ pulumi.set(__self__, "authentication_domain_id", authentication_domain_id)
31
+ if name is not None:
32
+ pulumi.set(__self__, "name", name)
33
+ if user_ids is not None:
34
+ pulumi.set(__self__, "user_ids", user_ids)
35
+
36
+ @property
37
+ @pulumi.getter(name="authenticationDomainId")
38
+ def authentication_domain_id(self) -> pulumi.Input[str]:
39
+ """
40
+ The ID of the authentication domain to which the group to be created would belong.
41
+ """
42
+ return pulumi.get(self, "authentication_domain_id")
43
+
44
+ @authentication_domain_id.setter
45
+ def authentication_domain_id(self, value: pulumi.Input[str]):
46
+ pulumi.set(self, "authentication_domain_id", value)
47
+
48
+ @property
49
+ @pulumi.getter
50
+ def name(self) -> Optional[pulumi.Input[str]]:
51
+ """
52
+ The name of the group to be created.
53
+ """
54
+ return pulumi.get(self, "name")
55
+
56
+ @name.setter
57
+ def name(self, value: Optional[pulumi.Input[str]]):
58
+ pulumi.set(self, "name", value)
59
+
60
+ @property
61
+ @pulumi.getter(name="userIds")
62
+ def user_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
63
+ """
64
+ A list of IDs of users to be included in the group to be created.
65
+
66
+ > **NOTE** The ID of an authentication domain can be retrieved using its name, via the data source `get_authentication_domain`, as shown in the example above. Head over to the documentation of this data source for more details and examples.
67
+
68
+ > **WARNING:** Changing the `authentication_domain_id` of a `Group` resource that has already been applied would result in a **replacement** of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the `authentication_domain_id` of an existing group is not supported.
69
+ """
70
+ return pulumi.get(self, "user_ids")
71
+
72
+ @user_ids.setter
73
+ def user_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
74
+ pulumi.set(self, "user_ids", value)
75
+
76
+
77
+ @pulumi.input_type
78
+ class _GroupState:
79
+ def __init__(__self__, *,
80
+ authentication_domain_id: Optional[pulumi.Input[str]] = None,
81
+ name: Optional[pulumi.Input[str]] = None,
82
+ user_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
83
+ """
84
+ Input properties used for looking up and filtering Group resources.
85
+ :param pulumi.Input[str] authentication_domain_id: The ID of the authentication domain to which the group to be created would belong.
86
+ :param pulumi.Input[str] name: The name of the group to be created.
87
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] user_ids: A list of IDs of users to be included in the group to be created.
88
+
89
+ > **NOTE** The ID of an authentication domain can be retrieved using its name, via the data source `get_authentication_domain`, as shown in the example above. Head over to the documentation of this data source for more details and examples.
90
+
91
+ > **WARNING:** Changing the `authentication_domain_id` of a `Group` resource that has already been applied would result in a **replacement** of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the `authentication_domain_id` of an existing group is not supported.
92
+ """
93
+ if authentication_domain_id is not None:
94
+ pulumi.set(__self__, "authentication_domain_id", authentication_domain_id)
95
+ if name is not None:
96
+ pulumi.set(__self__, "name", name)
97
+ if user_ids is not None:
98
+ pulumi.set(__self__, "user_ids", user_ids)
99
+
100
+ @property
101
+ @pulumi.getter(name="authenticationDomainId")
102
+ def authentication_domain_id(self) -> Optional[pulumi.Input[str]]:
103
+ """
104
+ The ID of the authentication domain to which the group to be created would belong.
105
+ """
106
+ return pulumi.get(self, "authentication_domain_id")
107
+
108
+ @authentication_domain_id.setter
109
+ def authentication_domain_id(self, value: Optional[pulumi.Input[str]]):
110
+ pulumi.set(self, "authentication_domain_id", value)
111
+
112
+ @property
113
+ @pulumi.getter
114
+ def name(self) -> Optional[pulumi.Input[str]]:
115
+ """
116
+ The name of the group to be created.
117
+ """
118
+ return pulumi.get(self, "name")
119
+
120
+ @name.setter
121
+ def name(self, value: Optional[pulumi.Input[str]]):
122
+ pulumi.set(self, "name", value)
123
+
124
+ @property
125
+ @pulumi.getter(name="userIds")
126
+ def user_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
127
+ """
128
+ A list of IDs of users to be included in the group to be created.
129
+
130
+ > **NOTE** The ID of an authentication domain can be retrieved using its name, via the data source `get_authentication_domain`, as shown in the example above. Head over to the documentation of this data source for more details and examples.
131
+
132
+ > **WARNING:** Changing the `authentication_domain_id` of a `Group` resource that has already been applied would result in a **replacement** of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the `authentication_domain_id` of an existing group is not supported.
133
+ """
134
+ return pulumi.get(self, "user_ids")
135
+
136
+ @user_ids.setter
137
+ def user_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
138
+ pulumi.set(self, "user_ids", value)
139
+
140
+
141
+ class Group(pulumi.CustomResource):
142
+ @overload
143
+ def __init__(__self__,
144
+ resource_name: str,
145
+ opts: Optional[pulumi.ResourceOptions] = None,
146
+ authentication_domain_id: Optional[pulumi.Input[str]] = None,
147
+ name: Optional[pulumi.Input[str]] = None,
148
+ user_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
149
+ __props__=None):
150
+ """
151
+ The `Group` resource facilitates creating, updating, and deleting groups in New Relic, while also enabling the addition and removal of users from these groups.
152
+
153
+ ## Example Usage
154
+
155
+ ```python
156
+ import pulumi
157
+ import pulumi_newrelic as newrelic
158
+
159
+ foo_authentication_domain = newrelic.get_authentication_domain(name="Test Authentication Domain")
160
+ foo_group = newrelic.Group("fooGroup",
161
+ authentication_domain_id=foo_authentication_domain.id,
162
+ user_ids=[
163
+ "0001112222",
164
+ "2221110000",
165
+ ])
166
+ ```
167
+ ## Additional Examples
168
+
169
+ ### Addition of New Users to a New Group
170
+
171
+ The following example illustrates the creation of a group using the `Group` resource, to which users created using the `User` resource are added.
172
+
173
+ ```python
174
+ import pulumi
175
+ import pulumi_newrelic as newrelic
176
+
177
+ foo_authentication_domain = newrelic.get_authentication_domain(name="Test Authentication Domain")
178
+ foo_user = newrelic.User("fooUser",
179
+ email_id="test_user_one@test.com",
180
+ authentication_domain_id=foo_authentication_domain.id,
181
+ user_type="CORE_USER_TIER")
182
+ bar = newrelic.User("bar",
183
+ email_id="test_user_two@test.com",
184
+ authentication_domain_id=foo_authentication_domain.id,
185
+ user_type="BASIC_USER_TIER")
186
+ foo_group = newrelic.Group("fooGroup",
187
+ authentication_domain_id=foo_authentication_domain.id,
188
+ user_ids=[
189
+ foo_user.id,
190
+ bar.id,
191
+ ])
192
+ ```
193
+
194
+ ### Addition of Existing Users to a New Group
195
+
196
+ The following example demonstrates the usage of the `Group` resource to create a group, wherein the `User` data source is employed to associate existing users with the newly formed group.
197
+
198
+ ```python
199
+ import pulumi
200
+ import pulumi_newrelic as newrelic
201
+
202
+ foo_authentication_domain = newrelic.get_authentication_domain(name="Test Authentication Domain")
203
+ foo_user = newrelic.get_user(authentication_domain_id=foo_authentication_domain.id,
204
+ email_id="test_user_one@test.com")
205
+ bar = newrelic.get_user(authentication_domain_id=foo_authentication_domain.id,
206
+ name="Test User Two")
207
+ foo_group = newrelic.Group("fooGroup",
208
+ authentication_domain_id=foo_authentication_domain.id,
209
+ user_ids=[
210
+ foo_user.id,
211
+ bar.id,
212
+ ])
213
+ ```
214
+
215
+ > **NOTE** Please note that the addition of users to groups is only possible when both the group and the users to be added to it belong to the _same authentication domain_. If the group being created and the users being added to it belong to different authentication domains, an error indicating `user not found` or an equivalent error will be thrown.
216
+
217
+ ## Import
218
+
219
+ A group can be imported using its ID. Example:
220
+
221
+ ```sh
222
+ $ pulumi import newrelic:index/group:Group foo <group_id>
223
+ ```
224
+
225
+ :param str resource_name: The name of the resource.
226
+ :param pulumi.ResourceOptions opts: Options for the resource.
227
+ :param pulumi.Input[str] authentication_domain_id: The ID of the authentication domain to which the group to be created would belong.
228
+ :param pulumi.Input[str] name: The name of the group to be created.
229
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] user_ids: A list of IDs of users to be included in the group to be created.
230
+
231
+ > **NOTE** The ID of an authentication domain can be retrieved using its name, via the data source `get_authentication_domain`, as shown in the example above. Head over to the documentation of this data source for more details and examples.
232
+
233
+ > **WARNING:** Changing the `authentication_domain_id` of a `Group` resource that has already been applied would result in a **replacement** of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the `authentication_domain_id` of an existing group is not supported.
234
+ """
235
+ ...
236
+ @overload
237
+ def __init__(__self__,
238
+ resource_name: str,
239
+ args: GroupArgs,
240
+ opts: Optional[pulumi.ResourceOptions] = None):
241
+ """
242
+ The `Group` resource facilitates creating, updating, and deleting groups in New Relic, while also enabling the addition and removal of users from these groups.
243
+
244
+ ## Example Usage
245
+
246
+ ```python
247
+ import pulumi
248
+ import pulumi_newrelic as newrelic
249
+
250
+ foo_authentication_domain = newrelic.get_authentication_domain(name="Test Authentication Domain")
251
+ foo_group = newrelic.Group("fooGroup",
252
+ authentication_domain_id=foo_authentication_domain.id,
253
+ user_ids=[
254
+ "0001112222",
255
+ "2221110000",
256
+ ])
257
+ ```
258
+ ## Additional Examples
259
+
260
+ ### Addition of New Users to a New Group
261
+
262
+ The following example illustrates the creation of a group using the `Group` resource, to which users created using the `User` resource are added.
263
+
264
+ ```python
265
+ import pulumi
266
+ import pulumi_newrelic as newrelic
267
+
268
+ foo_authentication_domain = newrelic.get_authentication_domain(name="Test Authentication Domain")
269
+ foo_user = newrelic.User("fooUser",
270
+ email_id="test_user_one@test.com",
271
+ authentication_domain_id=foo_authentication_domain.id,
272
+ user_type="CORE_USER_TIER")
273
+ bar = newrelic.User("bar",
274
+ email_id="test_user_two@test.com",
275
+ authentication_domain_id=foo_authentication_domain.id,
276
+ user_type="BASIC_USER_TIER")
277
+ foo_group = newrelic.Group("fooGroup",
278
+ authentication_domain_id=foo_authentication_domain.id,
279
+ user_ids=[
280
+ foo_user.id,
281
+ bar.id,
282
+ ])
283
+ ```
284
+
285
+ ### Addition of Existing Users to a New Group
286
+
287
+ The following example demonstrates the usage of the `Group` resource to create a group, wherein the `User` data source is employed to associate existing users with the newly formed group.
288
+
289
+ ```python
290
+ import pulumi
291
+ import pulumi_newrelic as newrelic
292
+
293
+ foo_authentication_domain = newrelic.get_authentication_domain(name="Test Authentication Domain")
294
+ foo_user = newrelic.get_user(authentication_domain_id=foo_authentication_domain.id,
295
+ email_id="test_user_one@test.com")
296
+ bar = newrelic.get_user(authentication_domain_id=foo_authentication_domain.id,
297
+ name="Test User Two")
298
+ foo_group = newrelic.Group("fooGroup",
299
+ authentication_domain_id=foo_authentication_domain.id,
300
+ user_ids=[
301
+ foo_user.id,
302
+ bar.id,
303
+ ])
304
+ ```
305
+
306
+ > **NOTE** Please note that the addition of users to groups is only possible when both the group and the users to be added to it belong to the _same authentication domain_. If the group being created and the users being added to it belong to different authentication domains, an error indicating `user not found` or an equivalent error will be thrown.
307
+
308
+ ## Import
309
+
310
+ A group can be imported using its ID. Example:
311
+
312
+ ```sh
313
+ $ pulumi import newrelic:index/group:Group foo <group_id>
314
+ ```
315
+
316
+ :param str resource_name: The name of the resource.
317
+ :param GroupArgs args: The arguments to use to populate this resource's properties.
318
+ :param pulumi.ResourceOptions opts: Options for the resource.
319
+ """
320
+ ...
321
+ def __init__(__self__, resource_name: str, *args, **kwargs):
322
+ resource_args, opts = _utilities.get_resource_args_opts(GroupArgs, pulumi.ResourceOptions, *args, **kwargs)
323
+ if resource_args is not None:
324
+ __self__._internal_init(resource_name, opts, **resource_args.__dict__)
325
+ else:
326
+ __self__._internal_init(resource_name, *args, **kwargs)
327
+
328
+ def _internal_init(__self__,
329
+ resource_name: str,
330
+ opts: Optional[pulumi.ResourceOptions] = None,
331
+ authentication_domain_id: Optional[pulumi.Input[str]] = None,
332
+ name: Optional[pulumi.Input[str]] = None,
333
+ user_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
334
+ __props__=None):
335
+ opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
336
+ if not isinstance(opts, pulumi.ResourceOptions):
337
+ raise TypeError('Expected resource options to be a ResourceOptions instance')
338
+ if opts.id is None:
339
+ if __props__ is not None:
340
+ raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
341
+ __props__ = GroupArgs.__new__(GroupArgs)
342
+
343
+ if authentication_domain_id is None and not opts.urn:
344
+ raise TypeError("Missing required property 'authentication_domain_id'")
345
+ __props__.__dict__["authentication_domain_id"] = authentication_domain_id
346
+ __props__.__dict__["name"] = name
347
+ __props__.__dict__["user_ids"] = user_ids
348
+ super(Group, __self__).__init__(
349
+ 'newrelic:index/group:Group',
350
+ resource_name,
351
+ __props__,
352
+ opts)
353
+
354
+ @staticmethod
355
+ def get(resource_name: str,
356
+ id: pulumi.Input[str],
357
+ opts: Optional[pulumi.ResourceOptions] = None,
358
+ authentication_domain_id: Optional[pulumi.Input[str]] = None,
359
+ name: Optional[pulumi.Input[str]] = None,
360
+ user_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None) -> 'Group':
361
+ """
362
+ Get an existing Group resource's state with the given name, id, and optional extra
363
+ properties used to qualify the lookup.
364
+
365
+ :param str resource_name: The unique name of the resulting resource.
366
+ :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
367
+ :param pulumi.ResourceOptions opts: Options for the resource.
368
+ :param pulumi.Input[str] authentication_domain_id: The ID of the authentication domain to which the group to be created would belong.
369
+ :param pulumi.Input[str] name: The name of the group to be created.
370
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] user_ids: A list of IDs of users to be included in the group to be created.
371
+
372
+ > **NOTE** The ID of an authentication domain can be retrieved using its name, via the data source `get_authentication_domain`, as shown in the example above. Head over to the documentation of this data source for more details and examples.
373
+
374
+ > **WARNING:** Changing the `authentication_domain_id` of a `Group` resource that has already been applied would result in a **replacement** of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the `authentication_domain_id` of an existing group is not supported.
375
+ """
376
+ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
377
+
378
+ __props__ = _GroupState.__new__(_GroupState)
379
+
380
+ __props__.__dict__["authentication_domain_id"] = authentication_domain_id
381
+ __props__.__dict__["name"] = name
382
+ __props__.__dict__["user_ids"] = user_ids
383
+ return Group(resource_name, opts=opts, __props__=__props__)
384
+
385
+ @property
386
+ @pulumi.getter(name="authenticationDomainId")
387
+ def authentication_domain_id(self) -> pulumi.Output[str]:
388
+ """
389
+ The ID of the authentication domain to which the group to be created would belong.
390
+ """
391
+ return pulumi.get(self, "authentication_domain_id")
392
+
393
+ @property
394
+ @pulumi.getter
395
+ def name(self) -> pulumi.Output[str]:
396
+ """
397
+ The name of the group to be created.
398
+ """
399
+ return pulumi.get(self, "name")
400
+
401
+ @property
402
+ @pulumi.getter(name="userIds")
403
+ def user_ids(self) -> pulumi.Output[Optional[Sequence[str]]]:
404
+ """
405
+ A list of IDs of users to be included in the group to be created.
406
+
407
+ > **NOTE** The ID of an authentication domain can be retrieved using its name, via the data source `get_authentication_domain`, as shown in the example above. Head over to the documentation of this data source for more details and examples.
408
+
409
+ > **WARNING:** Changing the `authentication_domain_id` of a `Group` resource that has already been applied would result in a **replacement** of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the `authentication_domain_id` of an existing group is not supported.
410
+ """
411
+ return pulumi.get(self, "user_ids")
412
+
@@ -398,6 +398,7 @@ class NotificationChannel(pulumi.CustomResource):
398
398
  ),
399
399
  newrelic.NotificationChannelPropertyArgs(
400
400
  key="service",
401
+ label="Service Name",
401
402
  value="PTQK3FM",
402
403
  ),
403
404
  newrelic.NotificationChannelPropertyArgs(
@@ -565,6 +566,18 @@ class NotificationChannel(pulumi.CustomResource):
565
566
 
566
567
  > **NOTE:** `AlertChannel` are legacy resources.
567
568
 
569
+ ## Import
570
+
571
+ Channels can only be used by a single workflow, therefore importing them is not particularly useful, because in the UI channels are created upon workflow creation.
572
+
573
+ Additionally, the channel id isn't available via the UI, and you'd need to look it up with the `channels` query in the NerdGraph API.
574
+
575
+ That being said, importing is possible using -
576
+
577
+ ```sh
578
+ $ pulumi import newrelic:index/notificationChannel:NotificationChannel foo <destination_id>
579
+ ```
580
+
568
581
  :param str resource_name: The name of the resource.
569
582
  :param pulumi.ResourceOptions opts: Options for the resource.
570
583
  :param pulumi.Input[int] account_id: Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
@@ -701,6 +714,7 @@ class NotificationChannel(pulumi.CustomResource):
701
714
  ),
702
715
  newrelic.NotificationChannelPropertyArgs(
703
716
  key="service",
717
+ label="Service Name",
704
718
  value="PTQK3FM",
705
719
  ),
706
720
  newrelic.NotificationChannelPropertyArgs(
@@ -868,6 +882,18 @@ class NotificationChannel(pulumi.CustomResource):
868
882
 
869
883
  > **NOTE:** `AlertChannel` are legacy resources.
870
884
 
885
+ ## Import
886
+
887
+ Channels can only be used by a single workflow, therefore importing them is not particularly useful, because in the UI channels are created upon workflow creation.
888
+
889
+ Additionally, the channel id isn't available via the UI, and you'd need to look it up with the `channels` query in the NerdGraph API.
890
+
891
+ That being said, importing is possible using -
892
+
893
+ ```sh
894
+ $ pulumi import newrelic:index/notificationChannel:NotificationChannel foo <destination_id>
895
+ ```
896
+
871
897
  :param str resource_name: The name of the resource.
872
898
  :param NotificationChannelArgs args: The arguments to use to populate this resource's properties.
873
899
  :param pulumi.ResourceOptions opts: Options for the resource.
@@ -301,7 +301,76 @@ class NotificationDestination(pulumi.CustomResource):
301
301
  type: Optional[pulumi.Input[str]] = None,
302
302
  __props__=None):
303
303
  """
304
- Create a NotificationDestination resource with the given unique name, props, and options.
304
+ ## Import
305
+
306
+ Destination id can be found in the Destinations page -> three dots at the right of the chosen destination -> copy destination id to clipboard.
307
+
308
+ This example is especially useful for slack destinations which *must* be imported.
309
+
310
+ 1. Add an empty resource to your terraform file:
311
+
312
+ terraform
313
+
314
+ resource "newrelic_notification_destination" "foo" {
315
+
316
+ }
317
+
318
+ ```sh
319
+ $ pulumi import newrelic:index/notificationDestination:NotificationDestination
320
+
321
+ Run import command: `newrelic_notification_destination.foo <destination_id>`
322
+ ```
323
+
324
+ 3. Run the following command after the import successfully done and copy the information to your resource:
325
+
326
+ `terraform state show newrelic_notification_destination.foo`
327
+
328
+ 4. Add `ignore_changes` attribute on `auth_token` in your imported resource:
329
+
330
+ terraform
331
+
332
+ lifecycle {
333
+
334
+ ignore_changes = [auth_token]
335
+
336
+ }
337
+
338
+ Your imported destination should look like that:
339
+
340
+ terraform
341
+
342
+ resource "newrelic_notification_destination" "foo" {
343
+
344
+ lifecycle {
345
+
346
+ ignore_changes = [auth_token]
347
+
348
+ }
349
+
350
+ name = "*********"
351
+
352
+ type = "SLACK"
353
+
354
+ auth_token {
355
+
356
+ prefix = "Bearer"
357
+
358
+ }
359
+
360
+ property {
361
+
362
+ key
363
+
364
+ = "teamName"
365
+
366
+ label = "Team Name"
367
+
368
+ value = "******"
369
+
370
+ }
371
+
372
+ }
373
+
305
374
  :param str resource_name: The name of the resource.
306
375
  :param pulumi.ResourceOptions opts: Options for the resource.
307
376
  :param pulumi.Input[int] account_id: Determines the New Relic account where the notification destination will be created. Defaults to the account associated with the API key used.
@@ -320,7 +389,76 @@ class NotificationDestination(pulumi.CustomResource):
320
389
  args: NotificationDestinationArgs,
321
390
  opts: Optional[pulumi.ResourceOptions] = None):
322
391
  """
323
- Create a NotificationDestination resource with the given unique name, props, and options.
392
+ ## Import
393
+
394
+ Destination id can be found in the Destinations page -> three dots at the right of the chosen destination -> copy destination id to clipboard.
395
+
396
+ This example is especially useful for slack destinations which *must* be imported.
397
+
398
+ 1. Add an empty resource to your terraform file:
399
+
400
+ terraform
401
+
402
+ resource "newrelic_notification_destination" "foo" {
403
+
404
+ }
405
+
406
+ ```sh
407
+ $ pulumi import newrelic:index/notificationDestination:NotificationDestination
408
+
409
+ Run import command: `newrelic_notification_destination.foo <destination_id>`
410
+ ```
411
+
412
+ 3. Run the following command after the import successfully done and copy the information to your resource:
413
+
414
+ `terraform state show newrelic_notification_destination.foo`
415
+
416
+ 4. Add `ignore_changes` attribute on `auth_token` in your imported resource:
417
+
418
+ terraform
419
+
420
+ lifecycle {
421
+
422
+ ignore_changes = [auth_token]
423
+
424
+ }
425
+
426
+ Your imported destination should look like that:
427
+
428
+ terraform
429
+
430
+ resource "newrelic_notification_destination" "foo" {
431
+
432
+ lifecycle {
433
+
434
+ ignore_changes = [auth_token]
435
+
436
+ }
437
+
438
+ name = "*********"
439
+
440
+ type = "SLACK"
441
+
442
+ auth_token {
443
+
444
+ prefix = "Bearer"
445
+
446
+ }
447
+
448
+ property {
449
+
450
+ key
451
+
452
+ = "teamName"
453
+
454
+ label = "Team Name"
455
+
456
+ value = "******"
457
+
458
+ }
459
+
460
+ }
461
+
324
462
  :param str resource_name: The name of the resource.
325
463
  :param NotificationDestinationArgs args: The arguments to use to populate this resource's properties.
326
464
  :param pulumi.ResourceOptions opts: Options for the resource.