newrelic-lambda-cli 0.9.7__py2.py3-none-any.whl → 0.9.8__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.
@@ -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",
@@ -118,6 +118,7 @@ def _add_new_relic(input, config, nr_license_key):
118
118
  success(
119
119
  "Already installed on function '%s'. Pass --upgrade (or -u) to allow "
120
120
  "upgrade or reinstall to latest layer version."
121
+ "Additionally pass --apm to enable APM Lambda mode."
121
122
  % config["Configuration"]["FunctionArn"]
122
123
  )
123
124
  return True
@@ -232,6 +233,13 @@ def _add_new_relic(input, config, nr_license_key):
232
233
  "CORECLR_PROFILER_PATH"
233
234
  ] = "/opt/lib/newrelic-dotnet-agent/libNewRelicProfiler.so"
234
235
 
236
+ if input.apm:
237
+ success(
238
+ "Enabling APM Lambda mode for function '%s' "
239
+ % config["Configuration"]["FunctionArn"]
240
+ )
241
+ update_kwargs["Environment"]["Variables"]["NEW_RELIC_APM_LAMBDA_MODE"] = "True"
242
+
235
243
  return update_kwargs
236
244
 
237
245
 
@@ -313,7 +321,25 @@ def install(input, function_arn):
313
321
  if input.verbose:
314
322
  click.echo(json.dumps(res, indent=2))
315
323
 
316
- success("Successfully installed layer on %s" % function_arn)
324
+ old_layers = config["Configuration"].get("Layers", [])
325
+ old_layer_arn = old_layers[0]["Arn"].rsplit(":", 1)[0] if old_layers else "None"
326
+ old_layer_version = (
327
+ old_layers[0]["Arn"].split(":")[-1] if old_layers else "None"
328
+ )
329
+ new_layer = update_kwargs["Layers"][0]
330
+ new_layer_arn = update_kwargs["Layers"][0].rsplit(":", 1)[0]
331
+ new_layer_version = update_kwargs["Layers"][0].split(":")[-1]
332
+
333
+ if old_layer_arn == "None":
334
+ success(
335
+ "Successfully installed Layer ARN %s for the function: %s"
336
+ % (new_layer, function_arn)
337
+ )
338
+ else:
339
+ success(
340
+ "Successfully upgraded Layer ARN %s from version: %s to version: %s for the function: %s"
341
+ % (new_layer_arn, old_layer_version, new_layer_version, function_arn)
342
+ )
317
343
  return True
318
344
 
319
345
 
@@ -412,7 +438,11 @@ def uninstall(input, function_arn):
412
438
  if input.verbose:
413
439
  click.echo(json.dumps(res, indent=2))
414
440
 
415
- success("Successfully uninstalled layer on %s" % function_arn)
441
+ old_layers = config["Configuration"].get("Layers", [])
442
+ old_layer_arn = old_layers[0]["Arn"] if old_layers else "None"
443
+ success(
444
+ "Successfully uninstalled Layer %s from %s" % (old_layer_arn, function_arn)
445
+ )
416
446
  return True
417
447
 
418
448
 
@@ -104,6 +104,7 @@ LAYER_INSTALL_KEYS = [
104
104
  "excludes",
105
105
  "layer_arn",
106
106
  "upgrade",
107
+ "apm",
107
108
  "enable_extension",
108
109
  "enable_extension_function_logs",
109
110
  "java_handler_method",
@@ -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.7
3
+ Version: 0.9.8
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
@@ -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=0Kiwx8h_sHcKAxSuwVCWbplAoE4jGiYXcHbS6xmLzP4,15447
6
+ newrelic_lambda_cli/layers.py,sha256=FOXOpvs0BHHj7XOFMBXuE7TOMiHnFNNxaeNWWnezdYs,16750
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=q5m6T027sYWFFCzO_6ADRBZrGG0tIoiROvq9jdEV6G4,3304
11
- newrelic_lambda_cli/utils.py,sha256=98Y0gvJtQk4RfQUrwnrq_tXm9b_0Agg__F5AKvHYqzQ,5663
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=O9QPutKfdMrDV9xk-IvF25hWdGJY7yFQA-6b3WbBWx8,6371
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.7.dist-info/licenses/LICENSE,sha256=uuxDzQm0yfq_tNZX0tQYzsZUVRIF0jm3dBLZUojSYzI,11345
23
- newrelic_lambda_cli-0.9.7.dist-info/METADATA,sha256=dVHarIKajyveA4EnJ-SWZWltzYsCpeUvqmiBexxrUkQ,27333
24
- newrelic_lambda_cli-0.9.7.dist-info/WHEEL,sha256=_z0Kb-VmhLeNt2nZ-PsoQBjD25rP0tBwgAyRYD7oTKI,109
25
- newrelic_lambda_cli-0.9.7.dist-info/entry_points.txt,sha256=iks2k9Y4WNgIecsDzreIvMV9pGCjwwKTf33LKKvl2A8,65
26
- newrelic_lambda_cli-0.9.7.dist-info/top_level.txt,sha256=dxX2w58VgSUFiPD8C_lFuY-T2C1kjfeY0xi8iTh0r44,20
27
- newrelic_lambda_cli-0.9.7.dist-info/RECORD,,
22
+ newrelic_lambda_cli-0.9.8.dist-info/licenses/LICENSE,sha256=uuxDzQm0yfq_tNZX0tQYzsZUVRIF0jm3dBLZUojSYzI,11345
23
+ newrelic_lambda_cli-0.9.8.dist-info/METADATA,sha256=uHoHZrCZ8yyue3qZaNmvSz2tUCrHIwlmDNuOwWNeq1U,27333
24
+ newrelic_lambda_cli-0.9.8.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
25
+ newrelic_lambda_cli-0.9.8.dist-info/entry_points.txt,sha256=iks2k9Y4WNgIecsDzreIvMV9pGCjwwKTf33LKKvl2A8,65
26
+ newrelic_lambda_cli-0.9.8.dist-info/top_level.txt,sha256=dxX2w58VgSUFiPD8C_lFuY-T2C1kjfeY0xi8iTh0r44,20
27
+ newrelic_lambda_cli-0.9.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any