pulumi-newrelic 5.23.0a1713333809__py3-none-any.whl → 5.23.0a1713975814__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.
- pulumi_newrelic/_inputs.py +110 -270
- pulumi_newrelic/account_management.py +20 -20
- pulumi_newrelic/alert_channel.py +76 -92
- pulumi_newrelic/alert_condition.py +104 -149
- pulumi_newrelic/alert_muting_rule.py +33 -35
- pulumi_newrelic/alert_policy.py +68 -43
- pulumi_newrelic/alert_policy_channel.py +12 -8
- pulumi_newrelic/cloud/_inputs.py +322 -1072
- pulumi_newrelic/cloud/aws_govcloud_link_account.py +4 -6
- pulumi_newrelic/cloud/aws_integrations.py +13 -15
- pulumi_newrelic/cloud/aws_link_account.py +4 -6
- pulumi_newrelic/cloud/azure_integrations.py +10 -12
- pulumi_newrelic/cloud/azure_link_account.py +4 -6
- pulumi_newrelic/cloud/gcp_integrations.py +6 -6
- pulumi_newrelic/cloud/gcp_link_account.py +4 -6
- pulumi_newrelic/cloud/outputs.py +322 -1072
- pulumi_newrelic/data_partition_rule.py +0 -4
- pulumi_newrelic/entity_tags.py +13 -17
- pulumi_newrelic/events_to_metrics_rule.py +2 -4
- pulumi_newrelic/get_account.py +0 -4
- pulumi_newrelic/get_application.py +8 -10
- pulumi_newrelic/get_authentication_domain.py +4 -8
- pulumi_newrelic/get_cloud_account.py +0 -4
- pulumi_newrelic/get_entity.py +28 -32
- pulumi_newrelic/get_group.py +42 -8
- pulumi_newrelic/get_key_transaction.py +8 -10
- pulumi_newrelic/get_obfuscation_expression.py +2 -4
- pulumi_newrelic/get_service_level_alert_helper.py +22 -46
- pulumi_newrelic/get_test_grok_pattern.py +4 -6
- pulumi_newrelic/get_user.py +0 -4
- pulumi_newrelic/group.py +40 -42
- pulumi_newrelic/infra_alert_condition.py +154 -131
- pulumi_newrelic/insights/event.py +8 -25
- pulumi_newrelic/log_parsing_rule.py +6 -10
- pulumi_newrelic/monitor_downtime.py +174 -193
- pulumi_newrelic/notification_channel.py +124 -150
- pulumi_newrelic/nrql_alert_condition.py +38 -48
- pulumi_newrelic/nrql_drop_rule.py +34 -38
- pulumi_newrelic/obfuscation_expression.py +2 -4
- pulumi_newrelic/obfuscation_rule.py +4 -4
- pulumi_newrelic/one_dashboard.py +42 -48
- pulumi_newrelic/one_dashboard_raw.py +86 -86
- pulumi_newrelic/outputs.py +110 -270
- pulumi_newrelic/plugins/_inputs.py +16 -16
- pulumi_newrelic/plugins/application_settings.py +6 -8
- pulumi_newrelic/plugins/outputs.py +16 -16
- pulumi_newrelic/plugins/workload.py +158 -40
- pulumi_newrelic/service_level.py +38 -123
- pulumi_newrelic/synthetics/alert_condition.py +34 -64
- pulumi_newrelic/synthetics/broken_links_monitor.py +18 -20
- pulumi_newrelic/synthetics/cert_check_monitor.py +16 -18
- pulumi_newrelic/synthetics/get_private_location.py +0 -8
- pulumi_newrelic/synthetics/get_secure_credential.py +0 -12
- pulumi_newrelic/synthetics/monitor.py +48 -52
- pulumi_newrelic/synthetics/multi_location_alert_condition.py +69 -83
- pulumi_newrelic/synthetics/private_location.py +6 -6
- pulumi_newrelic/synthetics/script_monitor.py +38 -42
- pulumi_newrelic/synthetics/secure_credential.py +25 -22
- pulumi_newrelic/synthetics/step_monitor.py +18 -20
- pulumi_newrelic/user.py +8 -10
- pulumi_newrelic/workflow.py +20 -24
- {pulumi_newrelic-5.23.0a1713333809.dist-info → pulumi_newrelic-5.23.0a1713975814.dist-info}/METADATA +1 -1
- pulumi_newrelic-5.23.0a1713975814.dist-info/RECORD +89 -0
- pulumi_newrelic-5.23.0a1713333809.dist-info/RECORD +0 -89
- {pulumi_newrelic-5.23.0a1713333809.dist-info → pulumi_newrelic-5.23.0a1713975814.dist-info}/WHEEL +0 -0
- {pulumi_newrelic-5.23.0a1713333809.dist-info → pulumi_newrelic-5.23.0a1713975814.dist-info}/top_level.txt +0 -0
@@ -170,7 +170,6 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
|
|
170
170
|
|
171
171
|
Firstly set up your service level objective, we recommend using local variables for the `target` and `time_window.rolling.count`, as they are also necessary for the helper.
|
172
172
|
|
173
|
-
<!--Start PulumiCodeChooser -->
|
174
173
|
```python
|
175
174
|
import pulumi
|
176
175
|
import pulumi_newrelic as newrelic
|
@@ -179,6 +178,7 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
|
|
179
178
|
foo_period = 28
|
180
179
|
foo = newrelic.ServiceLevel("foo",
|
181
180
|
guid="MXxBUE18QVBQTElDQVRJT058MQ",
|
181
|
+
name="Latency",
|
182
182
|
description="Proportion of requests that are served faster than a threshold.",
|
183
183
|
events=newrelic.ServiceLevelEventsArgs(
|
184
184
|
account_id=12345678,
|
@@ -201,27 +201,26 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
|
|
201
201
|
),
|
202
202
|
))
|
203
203
|
```
|
204
|
-
<!--End PulumiCodeChooser -->
|
205
204
|
Then use the helper to obtain the necessary fields to set up an alert on that Service Level.
|
206
205
|
Note that the Service Level was set up using bad events, that's why `is_bad_events` is set to `true`.
|
207
206
|
If the Service Level was configured with good events that would be unnecessary as the field defaults to `false`.
|
208
207
|
|
209
208
|
Here is an example of a `slow_burn` alert.
|
210
209
|
|
211
|
-
<!--Start PulumiCodeChooser -->
|
212
210
|
```python
|
213
211
|
import pulumi
|
214
212
|
import pulumi_newrelic as newrelic
|
215
213
|
|
216
214
|
foo_slow_burn = newrelic.get_service_level_alert_helper(alert_type="slow_burn",
|
217
|
-
sli_guid=
|
218
|
-
slo_target=
|
219
|
-
slo_period=
|
215
|
+
sli_guid=foo["sliGuid"],
|
216
|
+
slo_target=foo_target,
|
217
|
+
slo_period=foo_period,
|
220
218
|
is_bad_events=True)
|
221
|
-
your_condition = newrelic.NrqlAlertCondition("
|
219
|
+
your_condition = newrelic.NrqlAlertCondition("your_condition",
|
222
220
|
account_id=12345678,
|
223
221
|
policy_id=67890,
|
224
222
|
type="static",
|
223
|
+
name="Slow burn alert",
|
225
224
|
enabled=True,
|
226
225
|
violation_time_limit_seconds=259200,
|
227
226
|
nrql=newrelic.NrqlAlertConditionNrqlArgs(
|
@@ -239,26 +238,25 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
|
|
239
238
|
aggregation_delay="120",
|
240
239
|
slide_by=900)
|
241
240
|
```
|
242
|
-
<!--End PulumiCodeChooser -->
|
243
241
|
|
244
242
|
Here is an example of a custom alert:
|
245
243
|
|
246
|
-
<!--Start PulumiCodeChooser -->
|
247
244
|
```python
|
248
245
|
import pulumi
|
249
246
|
import pulumi_newrelic as newrelic
|
250
247
|
|
251
248
|
foo_custom = newrelic.get_service_level_alert_helper(alert_type="custom",
|
252
|
-
sli_guid=
|
253
|
-
slo_target=
|
254
|
-
slo_period=
|
249
|
+
sli_guid=foo["sliGuid"],
|
250
|
+
slo_target=foo_target,
|
251
|
+
slo_period=foo_period,
|
255
252
|
custom_tolerated_budget_consumption=4,
|
256
253
|
custom_evaluation_period=5400,
|
257
254
|
is_bad_events=True)
|
258
|
-
your_condition = newrelic.NrqlAlertCondition("
|
255
|
+
your_condition = newrelic.NrqlAlertCondition("your_condition",
|
259
256
|
account_id=12345678,
|
260
257
|
policy_id=67890,
|
261
258
|
type="static",
|
259
|
+
name="Custom burn alert",
|
262
260
|
enabled=True,
|
263
261
|
violation_time_limit_seconds=259200,
|
264
262
|
nrql=newrelic.NrqlAlertConditionNrqlArgs(
|
@@ -276,16 +274,6 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
|
|
276
274
|
aggregation_delay="120",
|
277
275
|
slide_by=60)
|
278
276
|
```
|
279
|
-
<!--End PulumiCodeChooser -->
|
280
|
-
|
281
|
-
|
282
|
-
:param str alert_type: The type of alert we want to set. Valid values are:
|
283
|
-
:param int custom_evaluation_period: Aggregation window taken into consideration in seconds. Mandatory if `alert_type` is `custom`.
|
284
|
-
:param float custom_tolerated_budget_consumption: How much budget you tolerate to consume during the custom evaluation period, valid values between `0` and `100`. Mandatory if `alert_type` is `custom`.
|
285
|
-
:param bool is_bad_events: If the SLI is defined using bad events. Defaults to `false`
|
286
|
-
:param str sli_guid: The guid of the sli we want to set the alert on.
|
287
|
-
:param int slo_period: The time window of the Service Level Objective in days. Valid values are `1`, `7` and `28`.
|
288
|
-
:param float slo_target: The target of the Service Level Objective, valid values between `0` and `100`.
|
289
277
|
"""
|
290
278
|
__args__ = dict()
|
291
279
|
__args__['alertType'] = alert_type
|
@@ -329,7 +317,6 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
|
|
329
317
|
|
330
318
|
Firstly set up your service level objective, we recommend using local variables for the `target` and `time_window.rolling.count`, as they are also necessary for the helper.
|
331
319
|
|
332
|
-
<!--Start PulumiCodeChooser -->
|
333
320
|
```python
|
334
321
|
import pulumi
|
335
322
|
import pulumi_newrelic as newrelic
|
@@ -338,6 +325,7 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
|
|
338
325
|
foo_period = 28
|
339
326
|
foo = newrelic.ServiceLevel("foo",
|
340
327
|
guid="MXxBUE18QVBQTElDQVRJT058MQ",
|
328
|
+
name="Latency",
|
341
329
|
description="Proportion of requests that are served faster than a threshold.",
|
342
330
|
events=newrelic.ServiceLevelEventsArgs(
|
343
331
|
account_id=12345678,
|
@@ -360,27 +348,26 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
|
|
360
348
|
),
|
361
349
|
))
|
362
350
|
```
|
363
|
-
<!--End PulumiCodeChooser -->
|
364
351
|
Then use the helper to obtain the necessary fields to set up an alert on that Service Level.
|
365
352
|
Note that the Service Level was set up using bad events, that's why `is_bad_events` is set to `true`.
|
366
353
|
If the Service Level was configured with good events that would be unnecessary as the field defaults to `false`.
|
367
354
|
|
368
355
|
Here is an example of a `slow_burn` alert.
|
369
356
|
|
370
|
-
<!--Start PulumiCodeChooser -->
|
371
357
|
```python
|
372
358
|
import pulumi
|
373
359
|
import pulumi_newrelic as newrelic
|
374
360
|
|
375
361
|
foo_slow_burn = newrelic.get_service_level_alert_helper(alert_type="slow_burn",
|
376
|
-
sli_guid=
|
377
|
-
slo_target=
|
378
|
-
slo_period=
|
362
|
+
sli_guid=foo["sliGuid"],
|
363
|
+
slo_target=foo_target,
|
364
|
+
slo_period=foo_period,
|
379
365
|
is_bad_events=True)
|
380
|
-
your_condition = newrelic.NrqlAlertCondition("
|
366
|
+
your_condition = newrelic.NrqlAlertCondition("your_condition",
|
381
367
|
account_id=12345678,
|
382
368
|
policy_id=67890,
|
383
369
|
type="static",
|
370
|
+
name="Slow burn alert",
|
384
371
|
enabled=True,
|
385
372
|
violation_time_limit_seconds=259200,
|
386
373
|
nrql=newrelic.NrqlAlertConditionNrqlArgs(
|
@@ -398,26 +385,25 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
|
|
398
385
|
aggregation_delay="120",
|
399
386
|
slide_by=900)
|
400
387
|
```
|
401
|
-
<!--End PulumiCodeChooser -->
|
402
388
|
|
403
389
|
Here is an example of a custom alert:
|
404
390
|
|
405
|
-
<!--Start PulumiCodeChooser -->
|
406
391
|
```python
|
407
392
|
import pulumi
|
408
393
|
import pulumi_newrelic as newrelic
|
409
394
|
|
410
395
|
foo_custom = newrelic.get_service_level_alert_helper(alert_type="custom",
|
411
|
-
sli_guid=
|
412
|
-
slo_target=
|
413
|
-
slo_period=
|
396
|
+
sli_guid=foo["sliGuid"],
|
397
|
+
slo_target=foo_target,
|
398
|
+
slo_period=foo_period,
|
414
399
|
custom_tolerated_budget_consumption=4,
|
415
400
|
custom_evaluation_period=5400,
|
416
401
|
is_bad_events=True)
|
417
|
-
your_condition = newrelic.NrqlAlertCondition("
|
402
|
+
your_condition = newrelic.NrqlAlertCondition("your_condition",
|
418
403
|
account_id=12345678,
|
419
404
|
policy_id=67890,
|
420
405
|
type="static",
|
406
|
+
name="Custom burn alert",
|
421
407
|
enabled=True,
|
422
408
|
violation_time_limit_seconds=259200,
|
423
409
|
nrql=newrelic.NrqlAlertConditionNrqlArgs(
|
@@ -435,15 +421,5 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
|
|
435
421
|
aggregation_delay="120",
|
436
422
|
slide_by=60)
|
437
423
|
```
|
438
|
-
<!--End PulumiCodeChooser -->
|
439
|
-
|
440
|
-
|
441
|
-
:param str alert_type: The type of alert we want to set. Valid values are:
|
442
|
-
:param int custom_evaluation_period: Aggregation window taken into consideration in seconds. Mandatory if `alert_type` is `custom`.
|
443
|
-
:param float custom_tolerated_budget_consumption: How much budget you tolerate to consume during the custom evaluation period, valid values between `0` and `100`. Mandatory if `alert_type` is `custom`.
|
444
|
-
:param bool is_bad_events: If the SLI is defined using bad events. Defaults to `false`
|
445
|
-
:param str sli_guid: The guid of the sli we want to set the alert on.
|
446
|
-
:param int slo_period: The time window of the Service Level Objective in days. Valid values are `1`, `7` and `28`.
|
447
|
-
:param float slo_target: The target of the Service Level Objective, valid values between `0` and `100`.
|
448
424
|
"""
|
449
425
|
...
|
@@ -91,18 +91,17 @@ def get_test_grok_pattern(account_id: Optional[int] = None,
|
|
91
91
|
"""
|
92
92
|
## Example Usage
|
93
93
|
|
94
|
-
<!--Start PulumiCodeChooser -->
|
95
94
|
```python
|
96
95
|
import pulumi
|
97
96
|
import pulumi_newrelic as newrelic
|
98
97
|
|
99
|
-
|
98
|
+
# Data source
|
99
|
+
foo = newrelic.get_test_grok_pattern(grok="%{IP:host_ip}",
|
100
100
|
log_lines=[
|
101
101
|
"host_ip: 43.3.120.2",
|
102
102
|
"bytes_received: 2048",
|
103
103
|
])
|
104
104
|
```
|
105
|
-
<!--End PulumiCodeChooser -->
|
106
105
|
|
107
106
|
|
108
107
|
:param int account_id: The New Relic account ID to operate on. This allows you to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
|
@@ -132,18 +131,17 @@ def get_test_grok_pattern_output(account_id: Optional[pulumi.Input[Optional[int]
|
|
132
131
|
"""
|
133
132
|
## Example Usage
|
134
133
|
|
135
|
-
<!--Start PulumiCodeChooser -->
|
136
134
|
```python
|
137
135
|
import pulumi
|
138
136
|
import pulumi_newrelic as newrelic
|
139
137
|
|
140
|
-
|
138
|
+
# Data source
|
139
|
+
foo = newrelic.get_test_grok_pattern(grok="%{IP:host_ip}",
|
141
140
|
log_lines=[
|
142
141
|
"host_ip: 43.3.120.2",
|
143
142
|
"bytes_received: 2048",
|
144
143
|
])
|
145
144
|
```
|
146
|
-
<!--End PulumiCodeChooser -->
|
147
145
|
|
148
146
|
|
149
147
|
:param int account_id: The New Relic account ID to operate on. This allows you to override the `account_id` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
|
pulumi_newrelic/get_user.py
CHANGED
@@ -81,7 +81,6 @@ def get_user(authentication_domain_id: Optional[str] = None,
|
|
81
81
|
## Example Usage
|
82
82
|
|
83
83
|
The below example illustrates fetching a the ID of a user (and other arguments) using the ID of the authentication domain the user belongs to, as well as a name and/or email ID, which can be used as criteria to search for a user who matches these specified parameters.
|
84
|
-
<!--Start PulumiCodeChooser -->
|
85
84
|
```python
|
86
85
|
import pulumi
|
87
86
|
import pulumi_newrelic as newrelic
|
@@ -92,7 +91,6 @@ def get_user(authentication_domain_id: Optional[str] = None,
|
|
92
91
|
user_two = newrelic.get_user(authentication_domain_id=foo.id,
|
93
92
|
email_id="test_user@random.com")
|
94
93
|
```
|
95
|
-
<!--End PulumiCodeChooser -->
|
96
94
|
|
97
95
|
|
98
96
|
:param str authentication_domain_id: The ID of the authentication domain the user to be searched for belongs to.
|
@@ -130,7 +128,6 @@ def get_user_output(authentication_domain_id: Optional[pulumi.Input[str]] = None
|
|
130
128
|
## Example Usage
|
131
129
|
|
132
130
|
The below example illustrates fetching a the ID of a user (and other arguments) using the ID of the authentication domain the user belongs to, as well as a name and/or email ID, which can be used as criteria to search for a user who matches these specified parameters.
|
133
|
-
<!--Start PulumiCodeChooser -->
|
134
131
|
```python
|
135
132
|
import pulumi
|
136
133
|
import pulumi_newrelic as newrelic
|
@@ -141,7 +138,6 @@ def get_user_output(authentication_domain_id: Optional[pulumi.Input[str]] = None
|
|
141
138
|
user_two = newrelic.get_user(authentication_domain_id=foo.id,
|
142
139
|
email_id="test_user@random.com")
|
143
140
|
```
|
144
|
-
<!--End PulumiCodeChooser -->
|
145
141
|
|
146
142
|
|
147
143
|
:param str authentication_domain_id: The ID of the authentication domain the user to be searched for belongs to.
|
pulumi_newrelic/group.py
CHANGED
@@ -152,20 +152,19 @@ class Group(pulumi.CustomResource):
|
|
152
152
|
|
153
153
|
## Example Usage
|
154
154
|
|
155
|
-
<!--Start PulumiCodeChooser -->
|
156
155
|
```python
|
157
156
|
import pulumi
|
158
157
|
import pulumi_newrelic as newrelic
|
159
158
|
|
160
|
-
|
161
|
-
foo_group = newrelic.Group("
|
162
|
-
|
159
|
+
foo = newrelic.get_authentication_domain(name="Test Authentication Domain")
|
160
|
+
foo_group = newrelic.Group("foo",
|
161
|
+
name="Test Group",
|
162
|
+
authentication_domain_id=foo.id,
|
163
163
|
user_ids=[
|
164
164
|
"0001112222",
|
165
165
|
"2221110000",
|
166
166
|
])
|
167
167
|
```
|
168
|
-
<!--End PulumiCodeChooser -->
|
169
168
|
|
170
169
|
## Additional Examples
|
171
170
|
|
@@ -173,51 +172,51 @@ class Group(pulumi.CustomResource):
|
|
173
172
|
|
174
173
|
The following example illustrates the creation of a group using the `Group` resource, to which users created using the `User` resource are added.
|
175
174
|
|
176
|
-
<!--Start PulumiCodeChooser -->
|
177
175
|
```python
|
178
176
|
import pulumi
|
179
177
|
import pulumi_newrelic as newrelic
|
180
178
|
|
181
|
-
|
182
|
-
foo_user = newrelic.User("
|
179
|
+
foo = newrelic.get_authentication_domain(name="Test Authentication Domain")
|
180
|
+
foo_user = newrelic.User("foo",
|
181
|
+
name="Test User One",
|
183
182
|
email_id="test_user_one@test.com",
|
184
|
-
authentication_domain_id=
|
183
|
+
authentication_domain_id=foo.id,
|
185
184
|
user_type="CORE_USER_TIER")
|
186
185
|
bar = newrelic.User("bar",
|
186
|
+
name="Test User Two",
|
187
187
|
email_id="test_user_two@test.com",
|
188
|
-
authentication_domain_id=
|
188
|
+
authentication_domain_id=foo.id,
|
189
189
|
user_type="BASIC_USER_TIER")
|
190
|
-
foo_group = newrelic.Group("
|
191
|
-
|
190
|
+
foo_group = newrelic.Group("foo",
|
191
|
+
name="Test Group",
|
192
|
+
authentication_domain_id=foo.id,
|
192
193
|
user_ids=[
|
193
194
|
foo_user.id,
|
194
195
|
bar.id,
|
195
196
|
])
|
196
197
|
```
|
197
|
-
<!--End PulumiCodeChooser -->
|
198
198
|
|
199
199
|
### Addition of Existing Users to a New Group
|
200
200
|
|
201
201
|
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.
|
202
202
|
|
203
|
-
<!--Start PulumiCodeChooser -->
|
204
203
|
```python
|
205
204
|
import pulumi
|
206
205
|
import pulumi_newrelic as newrelic
|
207
206
|
|
208
|
-
|
209
|
-
|
207
|
+
foo = newrelic.get_authentication_domain(name="Test Authentication Domain")
|
208
|
+
foo_get_user = newrelic.get_user(authentication_domain_id=foo.id,
|
210
209
|
email_id="test_user_one@test.com")
|
211
|
-
bar = newrelic.get_user(authentication_domain_id=
|
210
|
+
bar = newrelic.get_user(authentication_domain_id=foo.id,
|
212
211
|
name="Test User Two")
|
213
|
-
foo_group = newrelic.Group("
|
214
|
-
|
212
|
+
foo_group = newrelic.Group("foo",
|
213
|
+
name="Test Group",
|
214
|
+
authentication_domain_id=foo.id,
|
215
215
|
user_ids=[
|
216
|
-
|
216
|
+
foo_get_user.id,
|
217
217
|
bar.id,
|
218
218
|
])
|
219
219
|
```
|
220
|
-
<!--End PulumiCodeChooser -->
|
221
220
|
|
222
221
|
> **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.
|
223
222
|
|
@@ -250,20 +249,19 @@ class Group(pulumi.CustomResource):
|
|
250
249
|
|
251
250
|
## Example Usage
|
252
251
|
|
253
|
-
<!--Start PulumiCodeChooser -->
|
254
252
|
```python
|
255
253
|
import pulumi
|
256
254
|
import pulumi_newrelic as newrelic
|
257
255
|
|
258
|
-
|
259
|
-
foo_group = newrelic.Group("
|
260
|
-
|
256
|
+
foo = newrelic.get_authentication_domain(name="Test Authentication Domain")
|
257
|
+
foo_group = newrelic.Group("foo",
|
258
|
+
name="Test Group",
|
259
|
+
authentication_domain_id=foo.id,
|
261
260
|
user_ids=[
|
262
261
|
"0001112222",
|
263
262
|
"2221110000",
|
264
263
|
])
|
265
264
|
```
|
266
|
-
<!--End PulumiCodeChooser -->
|
267
265
|
|
268
266
|
## Additional Examples
|
269
267
|
|
@@ -271,51 +269,51 @@ class Group(pulumi.CustomResource):
|
|
271
269
|
|
272
270
|
The following example illustrates the creation of a group using the `Group` resource, to which users created using the `User` resource are added.
|
273
271
|
|
274
|
-
<!--Start PulumiCodeChooser -->
|
275
272
|
```python
|
276
273
|
import pulumi
|
277
274
|
import pulumi_newrelic as newrelic
|
278
275
|
|
279
|
-
|
280
|
-
foo_user = newrelic.User("
|
276
|
+
foo = newrelic.get_authentication_domain(name="Test Authentication Domain")
|
277
|
+
foo_user = newrelic.User("foo",
|
278
|
+
name="Test User One",
|
281
279
|
email_id="test_user_one@test.com",
|
282
|
-
authentication_domain_id=
|
280
|
+
authentication_domain_id=foo.id,
|
283
281
|
user_type="CORE_USER_TIER")
|
284
282
|
bar = newrelic.User("bar",
|
283
|
+
name="Test User Two",
|
285
284
|
email_id="test_user_two@test.com",
|
286
|
-
authentication_domain_id=
|
285
|
+
authentication_domain_id=foo.id,
|
287
286
|
user_type="BASIC_USER_TIER")
|
288
|
-
foo_group = newrelic.Group("
|
289
|
-
|
287
|
+
foo_group = newrelic.Group("foo",
|
288
|
+
name="Test Group",
|
289
|
+
authentication_domain_id=foo.id,
|
290
290
|
user_ids=[
|
291
291
|
foo_user.id,
|
292
292
|
bar.id,
|
293
293
|
])
|
294
294
|
```
|
295
|
-
<!--End PulumiCodeChooser -->
|
296
295
|
|
297
296
|
### Addition of Existing Users to a New Group
|
298
297
|
|
299
298
|
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.
|
300
299
|
|
301
|
-
<!--Start PulumiCodeChooser -->
|
302
300
|
```python
|
303
301
|
import pulumi
|
304
302
|
import pulumi_newrelic as newrelic
|
305
303
|
|
306
|
-
|
307
|
-
|
304
|
+
foo = newrelic.get_authentication_domain(name="Test Authentication Domain")
|
305
|
+
foo_get_user = newrelic.get_user(authentication_domain_id=foo.id,
|
308
306
|
email_id="test_user_one@test.com")
|
309
|
-
bar = newrelic.get_user(authentication_domain_id=
|
307
|
+
bar = newrelic.get_user(authentication_domain_id=foo.id,
|
310
308
|
name="Test User Two")
|
311
|
-
foo_group = newrelic.Group("
|
312
|
-
|
309
|
+
foo_group = newrelic.Group("foo",
|
310
|
+
name="Test Group",
|
311
|
+
authentication_domain_id=foo.id,
|
313
312
|
user_ids=[
|
314
|
-
|
313
|
+
foo_get_user.id,
|
315
314
|
bar.id,
|
316
315
|
])
|
317
316
|
```
|
318
|
-
<!--End PulumiCodeChooser -->
|
319
317
|
|
320
318
|
> **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.
|
321
319
|
|