newrelic-lambda-cli 0.9.8__tar.gz → 0.9.9__tar.gz

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.
Files changed (46) hide show
  1. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/PKG-INFO +10 -26
  2. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/README.md +9 -25
  3. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/layers.py +9 -0
  4. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli.egg-info/PKG-INFO +10 -26
  5. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/setup.py +1 -1
  6. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/tests/test_layers.py +79 -0
  7. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/CODE_OF_CONDUCT.md +0 -0
  8. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/CONTRIBUTING.md +0 -0
  9. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/LICENSE +0 -0
  10. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/MANIFEST.in +0 -0
  11. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/THIRD_PARTY_NOTICES.md +0 -0
  12. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/__init__.py +0 -0
  13. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/api.py +0 -0
  14. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/cli/__init__.py +0 -0
  15. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/cli/decorators.py +0 -0
  16. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/cli/functions.py +0 -0
  17. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/cli/integrations.py +0 -0
  18. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/cli/layers.py +0 -0
  19. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/cli/otel_ingestions.py +0 -0
  20. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/cli/subscriptions.py +0 -0
  21. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/cliutils.py +0 -0
  22. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/functions.py +0 -0
  23. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/integrations.py +0 -0
  24. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/otel_ingestions.py +0 -0
  25. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/permissions.py +0 -0
  26. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/subscriptions.py +0 -0
  27. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/templates/import-template.yaml +0 -0
  28. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/templates/license-key-secret.yaml +0 -0
  29. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/templates/nr-lambda-integration-role.yaml +0 -0
  30. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/types.py +0 -0
  31. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli/utils.py +0 -0
  32. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli.egg-info/SOURCES.txt +0 -0
  33. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli.egg-info/dependency_links.txt +0 -0
  34. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli.egg-info/entry_points.txt +0 -0
  35. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli.egg-info/not-zip-safe +0 -0
  36. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli.egg-info/requires.txt +0 -0
  37. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/newrelic_lambda_cli.egg-info/top_level.txt +0 -0
  38. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/pyproject.toml +0 -0
  39. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/setup.cfg +0 -0
  40. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/tests/test_api.py +0 -0
  41. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/tests/test_functions.py +0 -0
  42. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/tests/test_integrations.py +0 -0
  43. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/tests/test_new_relic_gql.py +0 -0
  44. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/tests/test_permissions.py +0 -0
  45. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/tests/test_subscriptions.py +0 -0
  46. {newrelic_lambda_cli-0.9.8 → newrelic_lambda_cli-0.9.9}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: newrelic-lambda-cli
3
- Version: 0.9.8
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
- * dotnetcore3.1
66
- * dotnet6
67
- * dotnet8
68
- * java8.al2
69
- * java11
70
- * java17
71
- * java21
72
- * nodejs16.x
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.3 <= 3.12
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
@@ -36,37 +36,21 @@ A CLI to install the New Relic AWS Lambda integration and layers.
36
36
 
37
37
  ## Runtimes Supported
38
38
 
39
- * dotnetcore3.1
40
- * dotnet6
41
- * dotnet8
42
- * java8.al2
43
- * java11
44
- * java17
45
- * java21
46
- * nodejs16.x
47
- * nodejs18.x
48
- * nodejs20.x
49
- * nodejs22.x
50
- * provided
51
- * provided.al2
52
- * provided.al2023
53
- * python3.7
54
- * python3.8
55
- * python3.9
56
- * python3.10
57
- * python3.11
58
- * python3.12
59
- * python3.13
60
- * ruby3.2
61
- * ruby3.3
62
- * ruby3.4
39
+ | Runtime | Versions |
40
+ |-------------|------------------------|
41
+ | Python | `python3.7`, `python3.8`, `python3.9`, `python3.10`, `python3.11`, `python3.12`, `python3.13` |
42
+ | Node.js | `nodejs16.x`, `nodejs18.x`, `nodejs20.x`, `nodejs22.x` |
43
+ | .NET | `dotnet3.1`, `dotnet6`, `dotnet8` |
44
+ | Java | `java8.al2`, `java11`, `java17`, `java21` |
45
+ | Provided | `provided`, `provided.al2`, `provided.al2023` |
46
+ | Ruby | `ruby3.2`, `ruby3.3`, `ruby3.4` |
63
47
 
64
48
  **Note:** Automatic handler wrapping is only supported for Node.js, Python, Java, and Ruby. For other runtimes,
65
49
  manual function wrapping is required using the runtime specific New Relic agent.
66
50
 
67
51
  ## Requirements
68
52
 
69
- * Python >= 3.3 <= 3.12
53
+ * Python >= 3.7 <= 3.13
70
54
  * 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)
71
55
 
72
56
  ## Recommendations
@@ -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
 
@@ -303,6 +304,14 @@ def install(input, function_arn):
303
304
 
304
305
  try:
305
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")
306
315
  except botocore.exceptions.ClientError as e:
307
316
  failure(
308
317
  "Failed to update configuration for '%s': %s"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: newrelic-lambda-cli
3
- Version: 0.9.8
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
- * dotnetcore3.1
66
- * dotnet6
67
- * dotnet8
68
- * java8.al2
69
- * java11
70
- * java17
71
- * java21
72
- * nodejs16.x
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.3 <= 3.12
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
@@ -6,7 +6,7 @@ README = open(os.path.join(os.path.dirname(__file__), "README.md"), "r").read()
6
6
 
7
7
  setup(
8
8
  name="newrelic-lambda-cli",
9
- version="0.9.8",
9
+ version="0.9.9",
10
10
  python_requires=">=3.3",
11
11
  description="A CLI to install the New Relic AWS Lambda integration and layers.",
12
12
  long_description=README,
@@ -263,6 +263,85 @@ def test_add_new_relic_apm_lambda_mode(aws_credentials, mock_function_config):
263
263
  )
264
264
 
265
265
 
266
+ def test_install_apm(aws_credentials, mock_function_config):
267
+ mock_session = MagicMock()
268
+ mock_session.region_name = "us-east-1"
269
+ expected_tags_after_tagging = {
270
+ "NR.Apm.Lambda.Mode": "true",
271
+ }
272
+
273
+ with patch(
274
+ "newrelic_lambda_cli.layers._get_license_key_outputs"
275
+ ) as mock_get_license_key_outputs:
276
+ mock_client = mock_session.client.return_value
277
+
278
+ mock_client.get_function.reset_mock(return_value=True)
279
+
280
+ config = mock_function_config("python3.12")
281
+ mock_client.get_function.return_value = config
282
+
283
+ mock_get_license_key_outputs.return_value = ("license_arn", "12345", "policy")
284
+
285
+ try:
286
+ install(
287
+ layer_install(
288
+ session=mock_session,
289
+ aws_region="us-east-1",
290
+ nr_account_id=12345,
291
+ apm=True,
292
+ ),
293
+ "APMLambda",
294
+ )
295
+ except UsageError as e:
296
+ print(f"UsageError: {e}")
297
+
298
+ mock_client.get_function.reset_mock()
299
+ config = mock_function_config("python3.12")
300
+ mock_client.get_function.return_value = config
301
+ mock_client.list_tags.return_value = {"Tags": expected_tags_after_tagging}
302
+ assert (
303
+ install(
304
+ layer_install(nr_account_id=12345, session=mock_session), "APMLambda"
305
+ )
306
+ is True
307
+ )
308
+
309
+ mock_client.assert_has_calls([call.get_function(FunctionName="APMLambda")])
310
+ mock_client.assert_has_calls(
311
+ [
312
+ call.update_function_configuration(
313
+ FunctionName="arn:aws:lambda:us-east-1:5558675309:function:aws-python3-dev-hello", # noqa
314
+ Environment={
315
+ "Variables": {
316
+ "EXISTING_ENV_VAR": "Hello World",
317
+ "NEW_RELIC_ACCOUNT_ID": "12345",
318
+ "NEW_RELIC_LAMBDA_HANDLER": "original_handler",
319
+ "NEW_RELIC_LAMBDA_EXTENSION_ENABLED": "false",
320
+ "NEW_RELIC_APM_LAMBDA_MODE": "True",
321
+ }
322
+ },
323
+ Layers=ANY,
324
+ Handler="newrelic_lambda_wrapper.handler",
325
+ )
326
+ ]
327
+ )
328
+
329
+ mock_client.assert_has_calls(
330
+ [
331
+ call.tag_resource(
332
+ Resource="arn:aws:lambda:us-east-1:5558675309:function:aws-python3-dev-hello",
333
+ Tags={
334
+ "NR.Apm.Lambda.Mode": "true",
335
+ },
336
+ )
337
+ ]
338
+ )
339
+
340
+ tags_from_list_tags = mock_client.list_tags(Resource="APMLambda")["Tags"]
341
+
342
+ assert tags_from_list_tags == expected_tags_after_tagging
343
+
344
+
266
345
  @mock_aws
267
346
  def test_add_new_relic_dotnet(aws_credentials, mock_function_config):
268
347
  session = boto3.Session(region_name="us-east-1")