pulumi-newrelic 5.21.0a1710157101__py3-none-any.whl → 5.39.0a1736849617__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.0a1736849617.dist-info}/METADATA +7 -6
- pulumi_newrelic-5.39.0a1736849617.dist-info/RECORD +90 -0
- {pulumi_newrelic-5.21.0a1710157101.dist-info → pulumi_newrelic-5.39.0a1736849617.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.0a1736849617.dist-info}/top_level.txt +0 -0
pulumi_newrelic/get_entity.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 *
|
@@ -23,16 +28,19 @@ class GetEntityResult:
|
|
23
28
|
"""
|
24
29
|
A collection of values returned by getEntity.
|
25
30
|
"""
|
26
|
-
def __init__(__self__, account_id=None, application_id=None, domain=None, guid=None, id=None, ignore_case=None, name=None, serving_apm_application_id=None, tags=None, type=None):
|
27
|
-
if account_id and not isinstance(account_id,
|
28
|
-
raise TypeError("Expected argument 'account_id' to be a
|
31
|
+
def __init__(__self__, account_id=None, application_id=None, domain=None, entity_tags=None, guid=None, id=None, ignore_case=None, ignore_not_found=None, name=None, serving_apm_application_id=None, tags=None, type=None):
|
32
|
+
if account_id and not isinstance(account_id, str):
|
33
|
+
raise TypeError("Expected argument 'account_id' to be a str")
|
29
34
|
pulumi.set(__self__, "account_id", account_id)
|
30
|
-
if application_id and not isinstance(application_id,
|
31
|
-
raise TypeError("Expected argument 'application_id' to be a
|
35
|
+
if application_id and not isinstance(application_id, str):
|
36
|
+
raise TypeError("Expected argument 'application_id' to be a str")
|
32
37
|
pulumi.set(__self__, "application_id", application_id)
|
33
38
|
if domain and not isinstance(domain, str):
|
34
39
|
raise TypeError("Expected argument 'domain' to be a str")
|
35
40
|
pulumi.set(__self__, "domain", domain)
|
41
|
+
if entity_tags and not isinstance(entity_tags, str):
|
42
|
+
raise TypeError("Expected argument 'entity_tags' to be a str")
|
43
|
+
pulumi.set(__self__, "entity_tags", entity_tags)
|
36
44
|
if guid and not isinstance(guid, str):
|
37
45
|
raise TypeError("Expected argument 'guid' to be a str")
|
38
46
|
pulumi.set(__self__, "guid", guid)
|
@@ -42,11 +50,14 @@ class GetEntityResult:
|
|
42
50
|
if ignore_case and not isinstance(ignore_case, bool):
|
43
51
|
raise TypeError("Expected argument 'ignore_case' to be a bool")
|
44
52
|
pulumi.set(__self__, "ignore_case", ignore_case)
|
53
|
+
if ignore_not_found and not isinstance(ignore_not_found, bool):
|
54
|
+
raise TypeError("Expected argument 'ignore_not_found' to be a bool")
|
55
|
+
pulumi.set(__self__, "ignore_not_found", ignore_not_found)
|
45
56
|
if name and not isinstance(name, str):
|
46
57
|
raise TypeError("Expected argument 'name' to be a str")
|
47
58
|
pulumi.set(__self__, "name", name)
|
48
|
-
if serving_apm_application_id and not isinstance(serving_apm_application_id,
|
49
|
-
raise TypeError("Expected argument 'serving_apm_application_id' to be a
|
59
|
+
if serving_apm_application_id and not isinstance(serving_apm_application_id, str):
|
60
|
+
raise TypeError("Expected argument 'serving_apm_application_id' to be a str")
|
50
61
|
pulumi.set(__self__, "serving_apm_application_id", serving_apm_application_id)
|
51
62
|
if tags and not isinstance(tags, list):
|
52
63
|
raise TypeError("Expected argument 'tags' to be a list")
|
@@ -57,12 +68,12 @@ class GetEntityResult:
|
|
57
68
|
|
58
69
|
@property
|
59
70
|
@pulumi.getter(name="accountId")
|
60
|
-
def account_id(self) ->
|
71
|
+
def account_id(self) -> str:
|
61
72
|
return pulumi.get(self, "account_id")
|
62
73
|
|
63
74
|
@property
|
64
75
|
@pulumi.getter(name="applicationId")
|
65
|
-
def application_id(self) ->
|
76
|
+
def application_id(self) -> str:
|
66
77
|
"""
|
67
78
|
The domain-specific application ID of the entity. Only returned for APM and Browser applications.
|
68
79
|
"""
|
@@ -73,6 +84,15 @@ class GetEntityResult:
|
|
73
84
|
def domain(self) -> str:
|
74
85
|
return pulumi.get(self, "domain")
|
75
86
|
|
87
|
+
@property
|
88
|
+
@pulumi.getter(name="entityTags")
|
89
|
+
def entity_tags(self) -> str:
|
90
|
+
"""
|
91
|
+
A JSON-encoded string, comprising tags associated with the entity fetched.
|
92
|
+
* See the **Additional Examples** section below, for an illustration depicting the usage of `jsondecode` with the attribute `entity_tags`, to get the tags associated with the entity fetched.
|
93
|
+
"""
|
94
|
+
return pulumi.get(self, "entity_tags")
|
95
|
+
|
76
96
|
@property
|
77
97
|
@pulumi.getter
|
78
98
|
def guid(self) -> str:
|
@@ -94,6 +114,11 @@ class GetEntityResult:
|
|
94
114
|
def ignore_case(self) -> Optional[bool]:
|
95
115
|
return pulumi.get(self, "ignore_case")
|
96
116
|
|
117
|
+
@property
|
118
|
+
@pulumi.getter(name="ignoreNotFound")
|
119
|
+
def ignore_not_found(self) -> Optional[bool]:
|
120
|
+
return pulumi.get(self, "ignore_not_found")
|
121
|
+
|
97
122
|
@property
|
98
123
|
@pulumi.getter
|
99
124
|
def name(self) -> str:
|
@@ -101,7 +126,7 @@ class GetEntityResult:
|
|
101
126
|
|
102
127
|
@property
|
103
128
|
@pulumi.getter(name="servingApmApplicationId")
|
104
|
-
def serving_apm_application_id(self) ->
|
129
|
+
def serving_apm_application_id(self) -> str:
|
105
130
|
"""
|
106
131
|
The browser-specific ID of the backing APM entity. Only returned for Browser applications.
|
107
132
|
"""
|
@@ -127,97 +152,47 @@ class AwaitableGetEntityResult(GetEntityResult):
|
|
127
152
|
account_id=self.account_id,
|
128
153
|
application_id=self.application_id,
|
129
154
|
domain=self.domain,
|
155
|
+
entity_tags=self.entity_tags,
|
130
156
|
guid=self.guid,
|
131
157
|
id=self.id,
|
132
158
|
ignore_case=self.ignore_case,
|
159
|
+
ignore_not_found=self.ignore_not_found,
|
133
160
|
name=self.name,
|
134
161
|
serving_apm_application_id=self.serving_apm_application_id,
|
135
162
|
tags=self.tags,
|
136
163
|
type=self.type)
|
137
164
|
|
138
165
|
|
139
|
-
def get_entity(account_id: Optional[
|
166
|
+
def get_entity(account_id: Optional[str] = None,
|
140
167
|
domain: Optional[str] = None,
|
168
|
+
entity_tags: Optional[str] = None,
|
141
169
|
ignore_case: Optional[bool] = None,
|
170
|
+
ignore_not_found: Optional[bool] = None,
|
142
171
|
name: Optional[str] = None,
|
143
|
-
tags: Optional[Sequence[
|
172
|
+
tags: Optional[Sequence[Union['GetEntityTagArgs', 'GetEntityTagArgsDict']]] = None,
|
144
173
|
type: Optional[str] = None,
|
145
174
|
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetEntityResult:
|
146
175
|
"""
|
147
|
-
Use this data source to
|
148
|
-
|
149
|
-
### Example: Filter By Account ID
|
150
|
-
|
151
|
-
The default behaviour of this data source is to retrieve entities matching the specified parameters (such as `name`, `domain`, `type`) from NerdGraph with the credentials specified in the configuration of the provider (account ID and API Key), filter them by the account ID specified in the configuration of the provider, and return the first match.
|
152
|
-
|
153
|
-
This would mean, if no entity with the specified search parameters is found associated with the account ID in the configuration of the provider, i.e. `NEW_RELIC_ACCOUNT_ID`, an error is thrown, stating that no matching entity has been found.
|
154
|
-
|
155
|
-
<!--Start PulumiCodeChooser -->
|
156
|
-
```python
|
157
|
-
import pulumi
|
158
|
-
import pulumi_newrelic as newrelic
|
159
|
-
|
160
|
-
app = newrelic.get_entity(domain="APM",
|
161
|
-
name="my-app",
|
162
|
-
type="APPLICATION")
|
163
|
-
```
|
164
|
-
<!--End PulumiCodeChooser -->
|
165
|
-
However, in order to cater to scenarios in which it could be necessary to retrieve an entity belonging to a subaccount using the account ID and API Key of the parent account (for instance, when entities with identical names are present in both the parent account and subaccounts, since matching entities from subaccounts too are returned by NerdGraph), the `account_id` attribute of this data source may be availed. This ensures that the account ID in the configuration of the provider, used to filter entities returned by the API is now overridden by the `account_id` specified in the configuration; i.e., in the below example, the data source would now return an entity matching the specified `name`, belonging to the account with the ID `account_id`.
|
166
|
-
<!--Start PulumiCodeChooser -->
|
167
|
-
```python
|
168
|
-
import pulumi
|
169
|
-
import pulumi_newrelic as newrelic
|
176
|
+
Use this data source to access information about an existing resource.
|
170
177
|
|
171
|
-
|
172
|
-
domain="APM",
|
173
|
-
name="my-app",
|
174
|
-
type="APPLICATION")
|
175
|
-
```
|
176
|
-
<!--End PulumiCodeChooser -->
|
177
|
-
The following example explains a use case along the lines of the aforementioned; using the `account_id` argument in the data source to allow the filtering criteria to be the `account_id` specified (of the subaccount), and not the account ID in the provider configuration.
|
178
|
-
|
179
|
-
In simpler terms, when entities are queried from the parent account, entities with matching names are returned from subaccounts too, hence, specifying the `account_id` of the subaccount in the configuration allows the entity returned to belong to the subaccount with `account_id`.
|
180
|
-
### Query for an OTEL entity
|
181
|
-
|
182
|
-
<!--Start PulumiCodeChooser -->
|
183
|
-
```python
|
184
|
-
import pulumi
|
185
|
-
import pulumi_newrelic as newrelic
|
186
|
-
|
187
|
-
app = newrelic.get_entity(domain="EXT",
|
188
|
-
name="my-otel-app",
|
189
|
-
tags=[newrelic.GetEntityTagArgs(
|
190
|
-
key="accountID",
|
191
|
-
value="12345",
|
192
|
-
)],
|
193
|
-
type="SERVICE")
|
194
|
-
```
|
195
|
-
<!--End PulumiCodeChooser -->
|
196
|
-
|
197
|
-
### Query for an entity by type (AWS Lambda entity in this example)
|
198
|
-
|
199
|
-
<!--Start PulumiCodeChooser -->
|
200
|
-
```python
|
201
|
-
import pulumi
|
202
|
-
import pulumi_newrelic as newrelic
|
203
|
-
|
204
|
-
app = newrelic.get_entity(name="my_lambda_trace",
|
205
|
-
type="AWSLAMBDAFUNCTION")
|
206
|
-
```
|
207
|
-
<!--End PulumiCodeChooser -->
|
208
|
-
|
209
|
-
|
210
|
-
:param int account_id: The New Relic account ID the entity to be returned would be associated with, i.e. if specified, the data source would filter matching entities received by `account_id` and return the first match. If not, matching entities are filtered by the account ID specified in the configuration of the provider. See the **Example: Filter By Account ID** section above for more details.
|
178
|
+
:param str account_id: The New Relic account ID the entity to be returned would be associated with, i.e. if specified, the data source would filter matching entities received by `account_id` and return the first match. If not, matching entities are filtered by the account ID specified in the configuration of the provider. See the **Example: Filter By Account ID** section above for more details.
|
211
179
|
:param str domain: The entity's domain. Valid values are APM, BROWSER, INFRA, MOBILE, SYNTH, and EXT. If not specified, all domains are searched.
|
180
|
+
:param str entity_tags: A JSON-encoded string, comprising tags associated with the entity fetched.
|
181
|
+
* See the **Additional Examples** section below, for an illustration depicting the usage of `jsondecode` with the attribute `entity_tags`, to get the tags associated with the entity fetched.
|
212
182
|
:param bool ignore_case: Ignore case of the `name` when searching for the entity. Defaults to false.
|
183
|
+
:param bool ignore_not_found: A boolean argument that, when set to true, prevents an error from being thrown when the queried entity is not found. Instead, a warning is displayed. Defaults to `false`.
|
184
|
+
|
185
|
+
> **WARNING:** Setting the `ignore_not_found` argument to `true` will display an 'entity not found' warning instead of throwing an error. This can lead to downstream errors if the values of attributes exported by this data source are used elsewhere, as all of these values would be null. Please use this argument at your own risk.
|
213
186
|
:param str name: The name of the entity in New Relic One. The first entity matching this name for the given search parameters will be returned.
|
214
|
-
:param Sequence[
|
187
|
+
:param Sequence[Union['GetEntityTagArgs', 'GetEntityTagArgsDict']] tags: A tag applied to the entity. See Nested tag blocks below for details.
|
215
188
|
:param str type: The entity's type. Valid values are APPLICATION, DASHBOARD, HOST, MONITOR, WORKLOAD, AWSLAMBDAFUNCTION, SERVICE_LEVEL, and KEY_TRANSACTION. Note: Other entity types may also be queryable as the list of entity types may fluctuate over time.
|
216
189
|
"""
|
217
190
|
__args__ = dict()
|
218
191
|
__args__['accountId'] = account_id
|
219
192
|
__args__['domain'] = domain
|
193
|
+
__args__['entityTags'] = entity_tags
|
220
194
|
__args__['ignoreCase'] = ignore_case
|
195
|
+
__args__['ignoreNotFound'] = ignore_not_found
|
221
196
|
__args__['name'] = name
|
222
197
|
__args__['tags'] = tags
|
223
198
|
__args__['type'] = type
|
@@ -228,92 +203,60 @@ def get_entity(account_id: Optional[int] = None,
|
|
228
203
|
account_id=pulumi.get(__ret__, 'account_id'),
|
229
204
|
application_id=pulumi.get(__ret__, 'application_id'),
|
230
205
|
domain=pulumi.get(__ret__, 'domain'),
|
206
|
+
entity_tags=pulumi.get(__ret__, 'entity_tags'),
|
231
207
|
guid=pulumi.get(__ret__, 'guid'),
|
232
208
|
id=pulumi.get(__ret__, 'id'),
|
233
209
|
ignore_case=pulumi.get(__ret__, 'ignore_case'),
|
210
|
+
ignore_not_found=pulumi.get(__ret__, 'ignore_not_found'),
|
234
211
|
name=pulumi.get(__ret__, 'name'),
|
235
212
|
serving_apm_application_id=pulumi.get(__ret__, 'serving_apm_application_id'),
|
236
213
|
tags=pulumi.get(__ret__, 'tags'),
|
237
214
|
type=pulumi.get(__ret__, 'type'))
|
238
|
-
|
239
|
-
|
240
|
-
@_utilities.lift_output_func(get_entity)
|
241
|
-
def get_entity_output(account_id: Optional[pulumi.Input[Optional[int]]] = None,
|
215
|
+
def get_entity_output(account_id: Optional[pulumi.Input[Optional[str]]] = None,
|
242
216
|
domain: Optional[pulumi.Input[Optional[str]]] = None,
|
217
|
+
entity_tags: Optional[pulumi.Input[Optional[str]]] = None,
|
243
218
|
ignore_case: Optional[pulumi.Input[Optional[bool]]] = None,
|
219
|
+
ignore_not_found: Optional[pulumi.Input[Optional[bool]]] = None,
|
244
220
|
name: Optional[pulumi.Input[str]] = None,
|
245
|
-
tags: Optional[pulumi.Input[Optional[Sequence[
|
221
|
+
tags: Optional[pulumi.Input[Optional[Sequence[Union['GetEntityTagArgs', 'GetEntityTagArgsDict']]]]] = None,
|
246
222
|
type: Optional[pulumi.Input[Optional[str]]] = None,
|
247
|
-
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetEntityResult]:
|
223
|
+
opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetEntityResult]:
|
248
224
|
"""
|
249
|
-
Use this data source to
|
225
|
+
Use this data source to access information about an existing resource.
|
250
226
|
|
251
|
-
|
252
|
-
|
253
|
-
The default behaviour of this data source is to retrieve entities matching the specified parameters (such as `name`, `domain`, `type`) from NerdGraph with the credentials specified in the configuration of the provider (account ID and API Key), filter them by the account ID specified in the configuration of the provider, and return the first match.
|
254
|
-
|
255
|
-
This would mean, if no entity with the specified search parameters is found associated with the account ID in the configuration of the provider, i.e. `NEW_RELIC_ACCOUNT_ID`, an error is thrown, stating that no matching entity has been found.
|
256
|
-
|
257
|
-
<!--Start PulumiCodeChooser -->
|
258
|
-
```python
|
259
|
-
import pulumi
|
260
|
-
import pulumi_newrelic as newrelic
|
261
|
-
|
262
|
-
app = newrelic.get_entity(domain="APM",
|
263
|
-
name="my-app",
|
264
|
-
type="APPLICATION")
|
265
|
-
```
|
266
|
-
<!--End PulumiCodeChooser -->
|
267
|
-
However, in order to cater to scenarios in which it could be necessary to retrieve an entity belonging to a subaccount using the account ID and API Key of the parent account (for instance, when entities with identical names are present in both the parent account and subaccounts, since matching entities from subaccounts too are returned by NerdGraph), the `account_id` attribute of this data source may be availed. This ensures that the account ID in the configuration of the provider, used to filter entities returned by the API is now overridden by the `account_id` specified in the configuration; i.e., in the below example, the data source would now return an entity matching the specified `name`, belonging to the account with the ID `account_id`.
|
268
|
-
<!--Start PulumiCodeChooser -->
|
269
|
-
```python
|
270
|
-
import pulumi
|
271
|
-
import pulumi_newrelic as newrelic
|
272
|
-
|
273
|
-
app = newrelic.get_entity(account_id=654321,
|
274
|
-
domain="APM",
|
275
|
-
name="my-app",
|
276
|
-
type="APPLICATION")
|
277
|
-
```
|
278
|
-
<!--End PulumiCodeChooser -->
|
279
|
-
The following example explains a use case along the lines of the aforementioned; using the `account_id` argument in the data source to allow the filtering criteria to be the `account_id` specified (of the subaccount), and not the account ID in the provider configuration.
|
280
|
-
|
281
|
-
In simpler terms, when entities are queried from the parent account, entities with matching names are returned from subaccounts too, hence, specifying the `account_id` of the subaccount in the configuration allows the entity returned to belong to the subaccount with `account_id`.
|
282
|
-
### Query for an OTEL entity
|
283
|
-
|
284
|
-
<!--Start PulumiCodeChooser -->
|
285
|
-
```python
|
286
|
-
import pulumi
|
287
|
-
import pulumi_newrelic as newrelic
|
288
|
-
|
289
|
-
app = newrelic.get_entity(domain="EXT",
|
290
|
-
name="my-otel-app",
|
291
|
-
tags=[newrelic.GetEntityTagArgs(
|
292
|
-
key="accountID",
|
293
|
-
value="12345",
|
294
|
-
)],
|
295
|
-
type="SERVICE")
|
296
|
-
```
|
297
|
-
<!--End PulumiCodeChooser -->
|
298
|
-
|
299
|
-
### Query for an entity by type (AWS Lambda entity in this example)
|
300
|
-
|
301
|
-
<!--Start PulumiCodeChooser -->
|
302
|
-
```python
|
303
|
-
import pulumi
|
304
|
-
import pulumi_newrelic as newrelic
|
305
|
-
|
306
|
-
app = newrelic.get_entity(name="my_lambda_trace",
|
307
|
-
type="AWSLAMBDAFUNCTION")
|
308
|
-
```
|
309
|
-
<!--End PulumiCodeChooser -->
|
310
|
-
|
311
|
-
|
312
|
-
:param int account_id: The New Relic account ID the entity to be returned would be associated with, i.e. if specified, the data source would filter matching entities received by `account_id` and return the first match. If not, matching entities are filtered by the account ID specified in the configuration of the provider. See the **Example: Filter By Account ID** section above for more details.
|
227
|
+
:param str account_id: The New Relic account ID the entity to be returned would be associated with, i.e. if specified, the data source would filter matching entities received by `account_id` and return the first match. If not, matching entities are filtered by the account ID specified in the configuration of the provider. See the **Example: Filter By Account ID** section above for more details.
|
313
228
|
:param str domain: The entity's domain. Valid values are APM, BROWSER, INFRA, MOBILE, SYNTH, and EXT. If not specified, all domains are searched.
|
229
|
+
:param str entity_tags: A JSON-encoded string, comprising tags associated with the entity fetched.
|
230
|
+
* See the **Additional Examples** section below, for an illustration depicting the usage of `jsondecode` with the attribute `entity_tags`, to get the tags associated with the entity fetched.
|
314
231
|
:param bool ignore_case: Ignore case of the `name` when searching for the entity. Defaults to false.
|
232
|
+
:param bool ignore_not_found: A boolean argument that, when set to true, prevents an error from being thrown when the queried entity is not found. Instead, a warning is displayed. Defaults to `false`.
|
233
|
+
|
234
|
+
> **WARNING:** Setting the `ignore_not_found` argument to `true` will display an 'entity not found' warning instead of throwing an error. This can lead to downstream errors if the values of attributes exported by this data source are used elsewhere, as all of these values would be null. Please use this argument at your own risk.
|
315
235
|
:param str name: The name of the entity in New Relic One. The first entity matching this name for the given search parameters will be returned.
|
316
|
-
:param Sequence[
|
236
|
+
:param Sequence[Union['GetEntityTagArgs', 'GetEntityTagArgsDict']] tags: A tag applied to the entity. See Nested tag blocks below for details.
|
317
237
|
:param str type: The entity's type. Valid values are APPLICATION, DASHBOARD, HOST, MONITOR, WORKLOAD, AWSLAMBDAFUNCTION, SERVICE_LEVEL, and KEY_TRANSACTION. Note: Other entity types may also be queryable as the list of entity types may fluctuate over time.
|
318
238
|
"""
|
319
|
-
|
239
|
+
__args__ = dict()
|
240
|
+
__args__['accountId'] = account_id
|
241
|
+
__args__['domain'] = domain
|
242
|
+
__args__['entityTags'] = entity_tags
|
243
|
+
__args__['ignoreCase'] = ignore_case
|
244
|
+
__args__['ignoreNotFound'] = ignore_not_found
|
245
|
+
__args__['name'] = name
|
246
|
+
__args__['tags'] = tags
|
247
|
+
__args__['type'] = type
|
248
|
+
opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
249
|
+
__ret__ = pulumi.runtime.invoke_output('newrelic:index/getEntity:getEntity', __args__, opts=opts, typ=GetEntityResult)
|
250
|
+
return __ret__.apply(lambda __response__: GetEntityResult(
|
251
|
+
account_id=pulumi.get(__response__, 'account_id'),
|
252
|
+
application_id=pulumi.get(__response__, 'application_id'),
|
253
|
+
domain=pulumi.get(__response__, 'domain'),
|
254
|
+
entity_tags=pulumi.get(__response__, 'entity_tags'),
|
255
|
+
guid=pulumi.get(__response__, 'guid'),
|
256
|
+
id=pulumi.get(__response__, 'id'),
|
257
|
+
ignore_case=pulumi.get(__response__, 'ignore_case'),
|
258
|
+
ignore_not_found=pulumi.get(__response__, 'ignore_not_found'),
|
259
|
+
name=pulumi.get(__response__, 'name'),
|
260
|
+
serving_apm_application_id=pulumi.get(__response__, 'serving_apm_application_id'),
|
261
|
+
tags=pulumi.get(__response__, 'tags'),
|
262
|
+
type=pulumi.get(__response__, 'type')))
|
pulumi_newrelic/get_group.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
|
|
12
17
|
__all__ = [
|
@@ -84,16 +89,33 @@ def get_group(authentication_domain_id: Optional[str] = None,
|
|
84
89
|
|
85
90
|
The below example illustrates fetching the ID of a group (and IDs of users who belong to the group, if any) using the required arguments.
|
86
91
|
|
87
|
-
<!--Start PulumiCodeChooser -->
|
88
92
|
```python
|
89
93
|
import pulumi
|
90
94
|
import pulumi_newrelic as newrelic
|
91
95
|
|
92
|
-
|
93
|
-
|
96
|
+
foo = newrelic.get_authentication_domain(name="Test Authentication Domain")
|
97
|
+
foo_get_group = newrelic.get_group(authentication_domain_id=foo.id,
|
94
98
|
name="Test Group")
|
95
99
|
```
|
96
|
-
|
100
|
+
|
101
|
+
## Additional Examples
|
102
|
+
|
103
|
+
The following example demonstrates utilizing attributes exported by this data source.
|
104
|
+
|
105
|
+
In order to directly reference the attributes `id` and `user_ids` from this data source, you can use the syntax `data.newrelic_group.foo.id` and `data.newrelic_group.foo.user_ids`, respectively. However, if you need to assign these values to local variables and perform further processing (such as conditionally formatting the `user_ids` attribute as shown in the example below), consider using the provided configuration. These variables can then be accessed elsewhere using the syntax `local.id` and `local.user_id`, respectively.
|
106
|
+
|
107
|
+
```python
|
108
|
+
import pulumi
|
109
|
+
import pulumi_newrelic as newrelic
|
110
|
+
import pulumi_std as std
|
111
|
+
|
112
|
+
foo = newrelic.get_authentication_domain(name="Test Authentication Domain")
|
113
|
+
foo_get_group = newrelic.get_group(authentication_domain_id=foo.id,
|
114
|
+
name="Test Group")
|
115
|
+
id = foo_get_group.id
|
116
|
+
user_ids = std.join(separator=", ",
|
117
|
+
input=foo_get_group.user_ids).result if len(foo_get_group.user_ids) > 0 else ""
|
118
|
+
```
|
97
119
|
|
98
120
|
|
99
121
|
:param str authentication_domain_id: The ID of the authentication domain the group to be searched for belongs to.
|
@@ -112,12 +134,9 @@ def get_group(authentication_domain_id: Optional[str] = None,
|
|
112
134
|
id=pulumi.get(__ret__, 'id'),
|
113
135
|
name=pulumi.get(__ret__, 'name'),
|
114
136
|
user_ids=pulumi.get(__ret__, 'user_ids'))
|
115
|
-
|
116
|
-
|
117
|
-
@_utilities.lift_output_func(get_group)
|
118
137
|
def get_group_output(authentication_domain_id: Optional[pulumi.Input[str]] = None,
|
119
138
|
name: Optional[pulumi.Input[str]] = None,
|
120
|
-
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetGroupResult]:
|
139
|
+
opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetGroupResult]:
|
121
140
|
"""
|
122
141
|
The `Group` data source helps search for a group by its name and retrieve the ID of the matching group and other associated attributes.
|
123
142
|
|
@@ -125,16 +144,33 @@ def get_group_output(authentication_domain_id: Optional[pulumi.Input[str]] = Non
|
|
125
144
|
|
126
145
|
The below example illustrates fetching the ID of a group (and IDs of users who belong to the group, if any) using the required arguments.
|
127
146
|
|
128
|
-
<!--Start PulumiCodeChooser -->
|
129
147
|
```python
|
130
148
|
import pulumi
|
131
149
|
import pulumi_newrelic as newrelic
|
132
150
|
|
133
|
-
|
134
|
-
|
151
|
+
foo = newrelic.get_authentication_domain(name="Test Authentication Domain")
|
152
|
+
foo_get_group = newrelic.get_group(authentication_domain_id=foo.id,
|
135
153
|
name="Test Group")
|
136
154
|
```
|
137
|
-
|
155
|
+
|
156
|
+
## Additional Examples
|
157
|
+
|
158
|
+
The following example demonstrates utilizing attributes exported by this data source.
|
159
|
+
|
160
|
+
In order to directly reference the attributes `id` and `user_ids` from this data source, you can use the syntax `data.newrelic_group.foo.id` and `data.newrelic_group.foo.user_ids`, respectively. However, if you need to assign these values to local variables and perform further processing (such as conditionally formatting the `user_ids` attribute as shown in the example below), consider using the provided configuration. These variables can then be accessed elsewhere using the syntax `local.id` and `local.user_id`, respectively.
|
161
|
+
|
162
|
+
```python
|
163
|
+
import pulumi
|
164
|
+
import pulumi_newrelic as newrelic
|
165
|
+
import pulumi_std as std
|
166
|
+
|
167
|
+
foo = newrelic.get_authentication_domain(name="Test Authentication Domain")
|
168
|
+
foo_get_group = newrelic.get_group(authentication_domain_id=foo.id,
|
169
|
+
name="Test Group")
|
170
|
+
id = foo_get_group.id
|
171
|
+
user_ids = std.join(separator=", ",
|
172
|
+
input=foo_get_group.user_ids).result if len(foo_get_group.user_ids) > 0 else ""
|
173
|
+
```
|
138
174
|
|
139
175
|
|
140
176
|
:param str authentication_domain_id: The ID of the authentication domain the group to be searched for belongs to.
|
@@ -142,4 +178,13 @@ def get_group_output(authentication_domain_id: Optional[pulumi.Input[str]] = Non
|
|
142
178
|
|
143
179
|
> **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.
|
144
180
|
"""
|
145
|
-
|
181
|
+
__args__ = dict()
|
182
|
+
__args__['authenticationDomainId'] = authentication_domain_id
|
183
|
+
__args__['name'] = name
|
184
|
+
opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
185
|
+
__ret__ = pulumi.runtime.invoke_output('newrelic:index/getGroup:getGroup', __args__, opts=opts, typ=GetGroupResult)
|
186
|
+
return __ret__.apply(lambda __response__: GetGroupResult(
|
187
|
+
authentication_domain_id=pulumi.get(__response__, 'authentication_domain_id'),
|
188
|
+
id=pulumi.get(__response__, 'id'),
|
189
|
+
name=pulumi.get(__response__, 'name'),
|
190
|
+
user_ids=pulumi.get(__response__, 'user_ids')))
|