newrelic-lambda-cli 0.9.7__py2.py3-none-any.whl → 0.9.9__py2.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.
- newrelic_lambda_cli/cli/layers.py +5 -0
- newrelic_lambda_cli/layers.py +41 -2
- newrelic_lambda_cli/types.py +1 -0
- newrelic_lambda_cli/utils.py +6 -0
- {newrelic_lambda_cli-0.9.7.dist-info → newrelic_lambda_cli-0.9.9.dist-info}/METADATA +10 -26
- {newrelic_lambda_cli-0.9.7.dist-info → newrelic_lambda_cli-0.9.9.dist-info}/RECORD +10 -10
- {newrelic_lambda_cli-0.9.7.dist-info → newrelic_lambda_cli-0.9.9.dist-info}/WHEEL +1 -1
- {newrelic_lambda_cli-0.9.7.dist-info → newrelic_lambda_cli-0.9.9.dist-info}/entry_points.txt +0 -0
- {newrelic_lambda_cli-0.9.7.dist-info → newrelic_lambda_cli-0.9.9.dist-info}/licenses/LICENSE +0 -0
- {newrelic_lambda_cli-0.9.7.dist-info → newrelic_lambda_cli-0.9.9.dist-info}/top_level.txt +0 -0
|
@@ -81,6 +81,11 @@ def register(group):
|
|
|
81
81
|
help="Permit upgrade of function layers to new version.",
|
|
82
82
|
is_flag=True,
|
|
83
83
|
)
|
|
84
|
+
@click.option(
|
|
85
|
+
"--apm",
|
|
86
|
+
help="Enable APM Lambda mode",
|
|
87
|
+
is_flag=True,
|
|
88
|
+
)
|
|
84
89
|
@click.option(
|
|
85
90
|
"--enable-extension/--disable-extension",
|
|
86
91
|
"-x",
|
newrelic_lambda_cli/layers.py
CHANGED
|
@@ -24,6 +24,7 @@ NEW_RELIC_ENV_VARS = (
|
|
|
24
24
|
"NEW_RELIC_LICENSE_KEY",
|
|
25
25
|
"NEW_RELIC_LOG_ENDPOINT",
|
|
26
26
|
"NEW_RELIC_TELEMETRY_ENDPOINT",
|
|
27
|
+
"NEW_RELIC_APM_LAMBDA_MODE",
|
|
27
28
|
)
|
|
28
29
|
|
|
29
30
|
|
|
@@ -118,6 +119,7 @@ def _add_new_relic(input, config, nr_license_key):
|
|
|
118
119
|
success(
|
|
119
120
|
"Already installed on function '%s'. Pass --upgrade (or -u) to allow "
|
|
120
121
|
"upgrade or reinstall to latest layer version."
|
|
122
|
+
"Additionally pass --apm to enable APM Lambda mode."
|
|
121
123
|
% config["Configuration"]["FunctionArn"]
|
|
122
124
|
)
|
|
123
125
|
return True
|
|
@@ -232,6 +234,13 @@ def _add_new_relic(input, config, nr_license_key):
|
|
|
232
234
|
"CORECLR_PROFILER_PATH"
|
|
233
235
|
] = "/opt/lib/newrelic-dotnet-agent/libNewRelicProfiler.so"
|
|
234
236
|
|
|
237
|
+
if input.apm:
|
|
238
|
+
success(
|
|
239
|
+
"Enabling APM Lambda mode for function '%s' "
|
|
240
|
+
% config["Configuration"]["FunctionArn"]
|
|
241
|
+
)
|
|
242
|
+
update_kwargs["Environment"]["Variables"]["NEW_RELIC_APM_LAMBDA_MODE"] = "True"
|
|
243
|
+
|
|
235
244
|
return update_kwargs
|
|
236
245
|
|
|
237
246
|
|
|
@@ -295,6 +304,14 @@ def install(input, function_arn):
|
|
|
295
304
|
|
|
296
305
|
try:
|
|
297
306
|
res = client.update_function_configuration(**update_kwargs)
|
|
307
|
+
if input.apm:
|
|
308
|
+
client.tag_resource(
|
|
309
|
+
Resource=config["Configuration"]["FunctionArn"],
|
|
310
|
+
Tags={
|
|
311
|
+
"NR.Apm.Lambda.Mode": "true",
|
|
312
|
+
},
|
|
313
|
+
)
|
|
314
|
+
success("Successfully added APM tag to the function")
|
|
298
315
|
except botocore.exceptions.ClientError as e:
|
|
299
316
|
failure(
|
|
300
317
|
"Failed to update configuration for '%s': %s"
|
|
@@ -313,7 +330,25 @@ def install(input, function_arn):
|
|
|
313
330
|
if input.verbose:
|
|
314
331
|
click.echo(json.dumps(res, indent=2))
|
|
315
332
|
|
|
316
|
-
|
|
333
|
+
old_layers = config["Configuration"].get("Layers", [])
|
|
334
|
+
old_layer_arn = old_layers[0]["Arn"].rsplit(":", 1)[0] if old_layers else "None"
|
|
335
|
+
old_layer_version = (
|
|
336
|
+
old_layers[0]["Arn"].split(":")[-1] if old_layers else "None"
|
|
337
|
+
)
|
|
338
|
+
new_layer = update_kwargs["Layers"][0]
|
|
339
|
+
new_layer_arn = update_kwargs["Layers"][0].rsplit(":", 1)[0]
|
|
340
|
+
new_layer_version = update_kwargs["Layers"][0].split(":")[-1]
|
|
341
|
+
|
|
342
|
+
if old_layer_arn == "None":
|
|
343
|
+
success(
|
|
344
|
+
"Successfully installed Layer ARN %s for the function: %s"
|
|
345
|
+
% (new_layer, function_arn)
|
|
346
|
+
)
|
|
347
|
+
else:
|
|
348
|
+
success(
|
|
349
|
+
"Successfully upgraded Layer ARN %s from version: %s to version: %s for the function: %s"
|
|
350
|
+
% (new_layer_arn, old_layer_version, new_layer_version, function_arn)
|
|
351
|
+
)
|
|
317
352
|
return True
|
|
318
353
|
|
|
319
354
|
|
|
@@ -412,7 +447,11 @@ def uninstall(input, function_arn):
|
|
|
412
447
|
if input.verbose:
|
|
413
448
|
click.echo(json.dumps(res, indent=2))
|
|
414
449
|
|
|
415
|
-
|
|
450
|
+
old_layers = config["Configuration"].get("Layers", [])
|
|
451
|
+
old_layer_arn = old_layers[0]["Arn"] if old_layers else "None"
|
|
452
|
+
success(
|
|
453
|
+
"Successfully uninstalled Layer %s from %s" % (old_layer_arn, function_arn)
|
|
454
|
+
)
|
|
416
455
|
return True
|
|
417
456
|
|
|
418
457
|
|
newrelic_lambda_cli/types.py
CHANGED
newrelic_lambda_cli/utils.py
CHANGED
|
@@ -131,6 +131,12 @@ def all_lambda_regions():
|
|
|
131
131
|
|
|
132
132
|
def is_valid_handler(runtime, handler):
|
|
133
133
|
runtime_handler = RUNTIME_CONFIG.get(runtime, {}).get("Handler", None)
|
|
134
|
+
if (
|
|
135
|
+
"nodejs" in runtime
|
|
136
|
+
and handler
|
|
137
|
+
== "/opt/nodejs/node_modules/newrelic-esm-lambda-wrapper/index.handler"
|
|
138
|
+
):
|
|
139
|
+
return True
|
|
134
140
|
if isinstance(runtime_handler, dict):
|
|
135
141
|
for _, valid_handler in runtime_handler.items():
|
|
136
142
|
if handler == valid_handler:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: newrelic-lambda-cli
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.9
|
|
4
4
|
Summary: A CLI to install the New Relic AWS Lambda integration and layers.
|
|
5
5
|
Home-page: https://github.com/newrelic/newrelic-lambda-cli
|
|
6
6
|
Author: New Relic
|
|
@@ -62,37 +62,21 @@ A CLI to install the New Relic AWS Lambda integration and layers.
|
|
|
62
62
|
|
|
63
63
|
## Runtimes Supported
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* nodejs18.x
|
|
74
|
-
* nodejs20.x
|
|
75
|
-
* nodejs22.x
|
|
76
|
-
* provided
|
|
77
|
-
* provided.al2
|
|
78
|
-
* provided.al2023
|
|
79
|
-
* python3.7
|
|
80
|
-
* python3.8
|
|
81
|
-
* python3.9
|
|
82
|
-
* python3.10
|
|
83
|
-
* python3.11
|
|
84
|
-
* python3.12
|
|
85
|
-
* python3.13
|
|
86
|
-
* ruby3.2
|
|
87
|
-
* ruby3.3
|
|
88
|
-
* ruby3.4
|
|
65
|
+
| Runtime | Versions |
|
|
66
|
+
|-------------|------------------------|
|
|
67
|
+
| Python | `python3.7`, `python3.8`, `python3.9`, `python3.10`, `python3.11`, `python3.12`, `python3.13` |
|
|
68
|
+
| Node.js | `nodejs16.x`, `nodejs18.x`, `nodejs20.x`, `nodejs22.x` |
|
|
69
|
+
| .NET | `dotnet3.1`, `dotnet6`, `dotnet8` |
|
|
70
|
+
| Java | `java8.al2`, `java11`, `java17`, `java21` |
|
|
71
|
+
| Provided | `provided`, `provided.al2`, `provided.al2023` |
|
|
72
|
+
| Ruby | `ruby3.2`, `ruby3.3`, `ruby3.4` |
|
|
89
73
|
|
|
90
74
|
**Note:** Automatic handler wrapping is only supported for Node.js, Python, Java, and Ruby. For other runtimes,
|
|
91
75
|
manual function wrapping is required using the runtime specific New Relic agent.
|
|
92
76
|
|
|
93
77
|
## Requirements
|
|
94
78
|
|
|
95
|
-
* Python >= 3.
|
|
79
|
+
* Python >= 3.7 <= 3.13
|
|
96
80
|
* Retrieve your [New relic Account ID](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/account-id) and [User API Key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#user-api-key)
|
|
97
81
|
|
|
98
82
|
## Recommendations
|
|
@@ -3,25 +3,25 @@ newrelic_lambda_cli/api.py,sha256=b75XwylRhW9pcA6aZ9EjBW1yIFOGHhhULDD5hNhMyes,15
|
|
|
3
3
|
newrelic_lambda_cli/cliutils.py,sha256=XDtvTlgbf2uVg01yCJrfJmmgxbF0nIL9x58ETyvefk8,685
|
|
4
4
|
newrelic_lambda_cli/functions.py,sha256=p57ZUw424BaSUA_Gw8DrYsJOYKROEHEaXgARadqwcP0,2800
|
|
5
5
|
newrelic_lambda_cli/integrations.py,sha256=r0gxfEqVHTGu3xbr4dOCDwm0-Yhoz3KntfeQRWvoWrQ,31266
|
|
6
|
-
newrelic_lambda_cli/layers.py,sha256=
|
|
6
|
+
newrelic_lambda_cli/layers.py,sha256=h-oZu8LiKmc6DXNhP2LlP6Uy9mxY_eHlIKUNQqx1IZ0,17075
|
|
7
7
|
newrelic_lambda_cli/otel_ingestions.py,sha256=vi1Mlfc9nRvRWV7STwK7fDXZGozG8ufKohmpHcaWGic,9250
|
|
8
8
|
newrelic_lambda_cli/permissions.py,sha256=H7v5IMpKaJIWC4Dff2YcTis4BKAAFIJr9IHWUj1LnF4,9093
|
|
9
9
|
newrelic_lambda_cli/subscriptions.py,sha256=-BYkltqiDLdmhUB_Ot4w-5vvrKcQC6aHcTBLl1mlUlI,9564
|
|
10
|
-
newrelic_lambda_cli/types.py,sha256=
|
|
11
|
-
newrelic_lambda_cli/utils.py,sha256=
|
|
10
|
+
newrelic_lambda_cli/types.py,sha256=7c9YIkOlU0ZDgs6yZLHVDEdOeeV-fk3EkuuqRKqqAp8,3315
|
|
11
|
+
newrelic_lambda_cli/utils.py,sha256=mtjhu0DEWOugS6-dS2u9cTSb6oC1TaQze_hFTrbi4Nk,5827
|
|
12
12
|
newrelic_lambda_cli/cli/__init__.py,sha256=FciF2RVqQbpMKqEiN8qjO6qmdLB6Yv8LyyyPYcfJNrc,622
|
|
13
13
|
newrelic_lambda_cli/cli/decorators.py,sha256=a3agkVfy8omkUSL4aKblwSX95xtxYOGASULDYcJDPHk,1786
|
|
14
14
|
newrelic_lambda_cli/cli/functions.py,sha256=RSh2Cowe1_oQup8q5YRidp03z-BITo2uzvDh4zvLr4I,2601
|
|
15
15
|
newrelic_lambda_cli/cli/integrations.py,sha256=aQAWcCCU2kBmbF8fLKwKB9bzSY0uipvnojajjTkhqEs,10461
|
|
16
|
-
newrelic_lambda_cli/cli/layers.py,sha256=
|
|
16
|
+
newrelic_lambda_cli/cli/layers.py,sha256=6eWN9yYaL8aZAWXn10MoPe6mH1_hPt8Q5fJ8Zc9oEYM,6454
|
|
17
17
|
newrelic_lambda_cli/cli/otel_ingestions.py,sha256=4rTm9iYUo2qdMeqxJSrYLCA6ZXHy5bJnjDn9x54pCYc,6096
|
|
18
18
|
newrelic_lambda_cli/cli/subscriptions.py,sha256=bUupv5iv3mUkC8t31nnI3BahoKxDnUJ8Rgq4QHJcFNU,5890
|
|
19
19
|
newrelic_lambda_cli/templates/import-template.yaml,sha256=0r1yeoqpnqtEMggWomALkPG10NiANPWWBqz03rChch8,3771
|
|
20
20
|
newrelic_lambda_cli/templates/license-key-secret.yaml,sha256=ZldQaLXsyF1K2I4X_AsLdH7kRmLkPUYI3talmhqQyHg,1849
|
|
21
21
|
newrelic_lambda_cli/templates/nr-lambda-integration-role.yaml,sha256=s7T73B_k-mAwgzJrD2xn8YGUNgn2E1V7Exifrl81ViU,2874
|
|
22
|
-
newrelic_lambda_cli-0.9.
|
|
23
|
-
newrelic_lambda_cli-0.9.
|
|
24
|
-
newrelic_lambda_cli-0.9.
|
|
25
|
-
newrelic_lambda_cli-0.9.
|
|
26
|
-
newrelic_lambda_cli-0.9.
|
|
27
|
-
newrelic_lambda_cli-0.9.
|
|
22
|
+
newrelic_lambda_cli-0.9.9.dist-info/licenses/LICENSE,sha256=uuxDzQm0yfq_tNZX0tQYzsZUVRIF0jm3dBLZUojSYzI,11345
|
|
23
|
+
newrelic_lambda_cli-0.9.9.dist-info/METADATA,sha256=6kP-GPMt67xGNPbjVtAPHp01HJOB_8xFgCMiW4Pp7no,27567
|
|
24
|
+
newrelic_lambda_cli-0.9.9.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
25
|
+
newrelic_lambda_cli-0.9.9.dist-info/entry_points.txt,sha256=iks2k9Y4WNgIecsDzreIvMV9pGCjwwKTf33LKKvl2A8,65
|
|
26
|
+
newrelic_lambda_cli-0.9.9.dist-info/top_level.txt,sha256=dxX2w58VgSUFiPD8C_lFuY-T2C1kjfeY0xi8iTh0r44,20
|
|
27
|
+
newrelic_lambda_cli-0.9.9.dist-info/RECORD,,
|
{newrelic_lambda_cli-0.9.7.dist-info → newrelic_lambda_cli-0.9.9.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{newrelic_lambda_cli-0.9.7.dist-info → newrelic_lambda_cli-0.9.9.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|