newrelic-lambda-cli 0.9.1__tar.gz → 0.9.2__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 (44) hide show
  1. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/PKG-INFO +3 -1
  2. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/README.md +2 -0
  3. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/cli/layers.py +10 -2
  4. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/cli/subscriptions.py +10 -2
  5. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/layers.py +12 -0
  6. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/utils.py +2 -0
  7. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli.egg-info/PKG-INFO +3 -1
  8. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/setup.py +1 -1
  9. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/tests/test_layers.py +63 -0
  10. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/tests/test_utils.py +2 -0
  11. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/CODE_OF_CONDUCT.md +0 -0
  12. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/CONTRIBUTING.md +0 -0
  13. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/LICENSE +0 -0
  14. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/MANIFEST.in +0 -0
  15. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/THIRD_PARTY_NOTICES.md +0 -0
  16. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/__init__.py +0 -0
  17. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/api.py +0 -0
  18. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/cli/__init__.py +0 -0
  19. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/cli/decorators.py +0 -0
  20. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/cli/functions.py +0 -0
  21. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/cli/integrations.py +0 -0
  22. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/cliutils.py +0 -0
  23. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/functions.py +0 -0
  24. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/integrations.py +0 -0
  25. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/permissions.py +0 -0
  26. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/subscriptions.py +0 -0
  27. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/templates/import-template.yaml +0 -0
  28. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/templates/license-key-secret.yaml +0 -0
  29. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/templates/nr-lambda-integration-role.yaml +0 -0
  30. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli/types.py +0 -0
  31. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli.egg-info/SOURCES.txt +0 -0
  32. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli.egg-info/dependency_links.txt +0 -0
  33. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli.egg-info/entry_points.txt +0 -0
  34. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli.egg-info/not-zip-safe +0 -0
  35. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli.egg-info/requires.txt +0 -0
  36. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/newrelic_lambda_cli.egg-info/top_level.txt +0 -0
  37. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/pyproject.toml +0 -0
  38. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/setup.cfg +0 -0
  39. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/tests/test_api.py +0 -0
  40. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/tests/test_functions.py +0 -0
  41. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/tests/test_integrations.py +0 -0
  42. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/tests/test_new_relic_gql.py +0 -0
  43. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/tests/test_permissions.py +0 -0
  44. {newrelic_lambda_cli-0.9.1 → newrelic_lambda_cli-0.9.2}/tests/test_subscriptions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newrelic-lambda-cli
3
- Version: 0.9.1
3
+ Version: 0.9.2
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
@@ -52,6 +52,8 @@ A CLI to install the New Relic AWS Lambda integration and layers.
52
52
  ## Runtimes Supported
53
53
 
54
54
  * dotnetcore3.1
55
+ * dotnet6
56
+ * dotnet8
55
57
  * java8.al2
56
58
  * java11
57
59
  * java17
@@ -34,6 +34,8 @@ A CLI to install the New Relic AWS Lambda integration and layers.
34
34
  ## Runtimes Supported
35
35
 
36
36
  * dotnetcore3.1
37
+ * dotnet6
38
+ * dotnet8
37
39
  * java8.al2
38
40
  * java11
39
41
  * java17
@@ -107,7 +107,11 @@ def register(group):
107
107
  def install(ctx, **kwargs):
108
108
  """Install New Relic AWS Lambda Layers"""
109
109
  input = LayerInstall(session=None, verbose=ctx.obj["VERBOSE"], **kwargs)
110
-
110
+ input = input._replace(
111
+ session=boto3.Session(
112
+ profile_name=input.aws_profile, region_name=input.aws_region
113
+ )
114
+ )
111
115
  if input.aws_permissions_check:
112
116
  permissions.ensure_layer_install_permissions(input)
113
117
 
@@ -181,7 +185,11 @@ def install(ctx, **kwargs):
181
185
  def uninstall(ctx, **kwargs):
182
186
  """Uninstall New Relic AWS Lambda Layers"""
183
187
  input = LayerUninstall(session=None, verbose=ctx.obj["VERBOSE"], **kwargs)
184
-
188
+ input = input._replace(
189
+ session=boto3.Session(
190
+ profile_name=input.aws_profile, region_name=input.aws_region
191
+ )
192
+ )
185
193
  if input.aws_permissions_check:
186
194
  permissions.ensure_layer_uninstall_permissions(input)
187
195
 
@@ -64,7 +64,11 @@ def register(group):
64
64
  def install(**kwargs):
65
65
  """Install New Relic AWS Lambda Log Subscriptions"""
66
66
  input = SubscriptionInstall(session=None, **kwargs)
67
-
67
+ input = input._replace(
68
+ session=boto3.Session(
69
+ profile_name=input.aws_profile, region_name=input.aws_region
70
+ )
71
+ )
68
72
  if input.aws_permissions_check:
69
73
  permissions.ensure_subscription_install_permissions(input)
70
74
 
@@ -121,7 +125,11 @@ def install(**kwargs):
121
125
  def uninstall(**kwargs):
122
126
  """Uninstall New Relic AWS Lambda Log Subscriptions"""
123
127
  input = SubscriptionUninstall(session=None, **kwargs)
124
-
128
+ input = input._replace(
129
+ session=boto3.Session(
130
+ profile_name=input.aws_profile, region_name=input.aws_region
131
+ )
132
+ )
125
133
  if input.aws_permissions_check:
126
134
  permissions.ensure_subscription_uninstall_permissions(input)
127
135
 
@@ -202,6 +202,18 @@ def _add_new_relic(input, config, nr_license_key):
202
202
  "NEW_RELIC_LAMBDA_EXTENSION_ENABLED"
203
203
  ] = "false"
204
204
 
205
+ if "dotnet" in runtime:
206
+ update_kwargs["Environment"]["Variables"]["CORECLR_ENABLE_PROFILING"] = "1"
207
+ update_kwargs["Environment"]["Variables"][
208
+ "CORECLR_PROFILER"
209
+ ] = "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}"
210
+ update_kwargs["Environment"]["Variables"][
211
+ "CORECLR_NEWRELIC_HOME"
212
+ ] = "/opt/lib/newrelic-dotnet-agent"
213
+ update_kwargs["Environment"]["Variables"][
214
+ "CORECLR_PROFILER_PATH"
215
+ ] = "/opt/lib/newrelic-dotnet-agent/libNewRelicProfiler.so"
216
+
205
217
  return update_kwargs
206
218
 
207
219
 
@@ -10,6 +10,8 @@ NR_DOCS_ACT_LINKING_URL = "https://docs.newrelic.com/docs/serverless-function-mo
10
10
  NEW_RELIC_ARN_PREFIX_TEMPLATE = "arn:aws:lambda:%s:451483290750"
11
11
  RUNTIME_CONFIG = {
12
12
  "dotnetcore3.1": {"LambdaExtension": True},
13
+ "dotnet6": {"LambdaExtension": True},
14
+ "dotnet8": {"LambdaExtension": True},
13
15
  "java21": {
14
16
  "Handler": "com.newrelic.java.HandlerWrapper::",
15
17
  "LambdaExtension": True,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newrelic-lambda-cli
3
- Version: 0.9.1
3
+ Version: 0.9.2
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
@@ -52,6 +52,8 @@ A CLI to install the New Relic AWS Lambda integration and layers.
52
52
  ## Runtimes Supported
53
53
 
54
54
  * dotnetcore3.1
55
+ * dotnet6
56
+ * dotnet8
55
57
  * java8.al2
56
58
  * java11
57
59
  * java17
@@ -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.1",
9
+ version="0.9.2",
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,
@@ -235,6 +235,69 @@ def test_add_new_relic(aws_credentials, mock_function_config):
235
235
  assert update_kwargs["Layers"][0] != get_arn_prefix("us-east-1")
236
236
 
237
237
 
238
+ @mock_lambda
239
+ def test_add_new_relic_dotnet(aws_credentials, mock_function_config):
240
+ session = boto3.Session(region_name="us-east-1")
241
+
242
+ test_runtimes = ["dotnet6", "dotnet8"]
243
+ for test_runtime in test_runtimes:
244
+ config = mock_function_config(test_runtime)
245
+
246
+ assert config["Configuration"]["Handler"] == "original_handler"
247
+
248
+ update_kwargs = _add_new_relic(
249
+ layer_install(
250
+ session=session,
251
+ aws_region="us-east-1",
252
+ nr_account_id=12345,
253
+ enable_extension=True,
254
+ enable_extension_function_logs=True,
255
+ ),
256
+ config,
257
+ nr_license_key=None,
258
+ )
259
+
260
+ # .NET doesn't require specifying a handler by default
261
+ assert "Handler" not in update_kwargs
262
+ assert (
263
+ "NEW_RELIC_LAMBDA_HANDLER" not in update_kwargs["Environment"]["Variables"]
264
+ )
265
+
266
+ assert update_kwargs["FunctionName"] == config["Configuration"]["FunctionArn"]
267
+ assert (
268
+ update_kwargs["Environment"]["Variables"]["NEW_RELIC_ACCOUNT_ID"] == "12345"
269
+ )
270
+ assert (
271
+ update_kwargs["Environment"]["Variables"][
272
+ "NEW_RELIC_LAMBDA_EXTENSION_ENABLED"
273
+ ]
274
+ == "true"
275
+ )
276
+ assert (
277
+ update_kwargs["Environment"]["Variables"][
278
+ "NEW_RELIC_EXTENSION_SEND_FUNCTION_LOGS"
279
+ ]
280
+ == "true"
281
+ )
282
+
283
+ # .NET specific environment variables
284
+ assert (
285
+ update_kwargs["Environment"]["Variables"]["CORECLR_ENABLE_PROFILING"] == "1"
286
+ )
287
+ assert (
288
+ update_kwargs["Environment"]["Variables"]["CORECLR_PROFILER"]
289
+ == "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}"
290
+ )
291
+ assert (
292
+ update_kwargs["Environment"]["Variables"]["CORECLR_NEWRELIC_HOME"]
293
+ == "/opt/lib/newrelic-dotnet-agent"
294
+ )
295
+ assert (
296
+ update_kwargs["Environment"]["Variables"]["CORECLR_PROFILER_PATH"]
297
+ == "/opt/lib/newrelic-dotnet-agent/libNewRelicProfiler.so"
298
+ )
299
+
300
+
238
301
  @mock_lambda
239
302
  def test_remove_new_relic(aws_credentials, mock_function_config):
240
303
  session = boto3.Session(region_name="us-east-1")
@@ -77,6 +77,8 @@ def test_supports_lambda_extension():
77
77
  supports_lambda_extension(runtime)
78
78
  for runtime in (
79
79
  "dotnetcore3.1",
80
+ "dotnet6",
81
+ "dotnet8",
80
82
  "java21",
81
83
  "java17",
82
84
  "java11",