newrelic-lambda-cli 0.9.14__py2.py3-none-any.whl → 0.9.16__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.
@@ -96,24 +96,23 @@ class NewRelicGQL(object):
96
96
  """
97
97
  res = self.query(
98
98
  """
99
- query ($accountId: Int!) {
100
- requestContext {
101
- apiKey
102
- }
103
- actor {
104
- account(id: $accountId) {
105
- licenseKey
106
- id
107
- name
99
+ query ($accountId: Int!) {
100
+ actor {
101
+ apiAccess {
102
+ keySearch(query: {types: INGEST, scope: {accountIds: [$accountId]}}) {
103
+ keys {
104
+ key
105
+ }
106
+ }
107
+ }
108
+ }
108
109
  }
109
- }
110
- }
111
110
  """,
112
111
  accountId=self.account_id,
113
112
  )
114
113
  try:
115
- return res["actor"]["account"]["licenseKey"]
116
- except KeyError:
114
+ return res["actor"]["apiAccess"]["keySearch"]["keys"][0]["key"]
115
+ except (KeyError, IndexError):
117
116
  return None
118
117
 
119
118
  def get_linked_account_by_id(self, id):
@@ -133,6 +133,12 @@ def register(group):
133
133
  is_flag=True,
134
134
  help="Enable sending Lambda function logs via the New Relic Lambda Extension",
135
135
  )
136
+ @click.option(
137
+ "--slim",
138
+ is_flag=True,
139
+ default=False,
140
+ help="New Relic slim Layer without opentelemetry for Node.js",
141
+ )
136
142
  @click.option(
137
143
  "--disable-function-logs",
138
144
  is_flag=True,
@@ -48,7 +48,12 @@ def index(region, runtime, architecture):
48
48
 
49
49
 
50
50
  def layer_selection(
51
- available_layers, runtime, architecture, upgrade=False, existing_layer_arn=None
51
+ available_layers,
52
+ runtime,
53
+ architecture,
54
+ upgrade=False,
55
+ existing_layer_arn=None,
56
+ slim=False,
52
57
  ):
53
58
  if upgrade and existing_layer_arn:
54
59
  base_arn = existing_layer_arn.rsplit(":", 1)[0]
@@ -65,7 +70,11 @@ def layer_selection(
65
70
  layer_options = [
66
71
  layer["LatestMatchingVersion"]["LayerVersionArn"] for layer in available_layers
67
72
  ]
68
-
73
+ if slim:
74
+ for arn in layer_options:
75
+ if "-slim:" in arn:
76
+ success("Layer %s selected (slim)" % arn)
77
+ return arn
69
78
  if sys.stdout.isatty():
70
79
  output = "\n".join(
71
80
  [
@@ -86,11 +95,14 @@ def layer_selection(
86
95
  except IndexError:
87
96
  failure("Invalid layer selection")
88
97
  else:
89
- raise click.UsageError(
98
+ click.echo(
90
99
  "Discovered multiple layers for runtime %s (%s):\n%s\n"
91
- "Pass --layer-arn to specify a layer ARN"
100
+ "To add a particular Layer ARN use --layer-arn"
92
101
  % (runtime, architecture, "\n".join(layer_options))
93
102
  )
103
+ selected = layer_options[0]
104
+ success("Layer %s selected (auto)" % selected)
105
+ return selected
94
106
 
95
107
 
96
108
  def _add_new_relic(input, config, nr_license_key):
@@ -167,6 +179,7 @@ def _add_new_relic(input, config, nr_license_key):
167
179
  architecture,
168
180
  upgrade=input.upgrade,
169
181
  existing_layer_arn=existing_layer_arn,
182
+ slim=input.slim,
170
183
  )
171
184
 
172
185
  update_kwargs = {
@@ -117,6 +117,7 @@ LAYER_INSTALL_KEYS = [
117
117
  "disable_extension_logs",
118
118
  "java_handler_method",
119
119
  "esm",
120
+ "slim",
120
121
  ]
121
122
 
122
123
  LAYER_UNINSTALL_KEYS = [
@@ -44,6 +44,10 @@ RUNTIME_CONFIG = {
44
44
  "Handler": "newrelic-lambda-wrapper.handler",
45
45
  "LambdaExtension": True,
46
46
  },
47
+ "nodejs24.x": {
48
+ "Handler": "newrelic-lambda-wrapper.handler",
49
+ "LambdaExtension": True,
50
+ },
47
51
  "provided": {"LambdaExtension": True},
48
52
  "provided.al2": {"LambdaExtension": True},
49
53
  "provided.al2023": {"LambdaExtension": True},
@@ -75,6 +79,10 @@ RUNTIME_CONFIG = {
75
79
  "Handler": "newrelic_lambda_wrapper.handler",
76
80
  "LambdaExtension": True,
77
81
  },
82
+ "python3.14": {
83
+ "Handler": "newrelic_lambda_wrapper.handler",
84
+ "LambdaExtension": True,
85
+ },
78
86
  "ruby3.2": {
79
87
  "Handler": "newrelic_lambda_wrapper.handler",
80
88
  "LambdaExtension": True,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: newrelic-lambda-cli
3
- Version: 0.9.14
3
+ Version: 0.9.16
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
@@ -64,11 +64,11 @@ A CLI to install the New Relic AWS Lambda integration and layers.
64
64
 
65
65
  | Runtime | Versions |
66
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` |
67
+ | Python | `python3.8`, `python3.9`, `python3.10`, `python3.11`, `python3.12`, `python3.13`, `python3.14` |
68
+ | Node.js | `nodejs16.x`, `nodejs18.x`, `nodejs20.x`, `nodejs22.x`, `nodejs24.x` |
69
+ | .NET | `dotnet6`, `dotnet8` |
70
70
  | Java | `java8.al2`, `java11`, `java17`, `java21` |
71
- | Provided | `provided`, `provided.al2`, `provided.al2023` |
71
+ | Provided | `provided.al2`, `provided.al2023` |
72
72
  | Ruby | `ruby3.2`, `ruby3.3`, `ruby3.4` |
73
73
 
74
74
  **Note:** Automatic handler wrapping is only supported for Node.js, Python, Java, and Ruby. For other runtimes,
@@ -78,6 +78,7 @@ manual function wrapping is required using the runtime specific New Relic agent.
78
78
 
79
79
  * Python >= 3.7 <= 3.13
80
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)
81
+ * Retrieve your [New Relic Ingest License Key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#personal-api-key)
81
82
 
82
83
  ## Recommendations
83
84
 
@@ -199,6 +200,7 @@ newrelic-lambda layers install \
199
200
  | `--function` or `-f` | Yes | The AWS Lambda function name or ARN in which to add a layer. Can provide multiple `--function` arguments. Will also accept `all`, `installed` and `not-installed` similar to `newrelic-lambda functions list`. |
200
201
  | `--nr-account-id` or `-a` | Yes | The [New Relic Account ID](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/account-id) this function should use. Can also use the `NEW_RELIC_ACCOUNT_ID` environment variable. |
201
202
  | `--exclude` or `-e` | No | A function name to exclude while installing layers. Can provide multiple `--exclude` arguments. Only checked when `all`, `installed` and `not-installed` are used. See `newrelic-lambda functions list` for function names. |
203
+ | `--slim` | No | The flag `--slim` adds the Node.js layer without OpenTelemetry dependencies, resulting in a lighter size. |
202
204
  | `--layer-arn` or `-l` | No | Specify a specific layer version ARN to use. This is auto detected by default. |
203
205
  | `--upgrade` or `-u` | No | Permit upgrade to the latest layer version for this region and runtime. |
204
206
  | `--disable-extension` | No | Disable the [New Relic Lambda Extension](https://github.com/newrelic/newrelic-lambda-extension). |
@@ -209,6 +211,7 @@ newrelic-lambda layers install \
209
211
  | `--aws-profile` or `-p` | No | The AWS profile to use for this command. Can also use `AWS_PROFILE`. Will also check `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables if not using AWS CLI. |
210
212
  | `--aws-region` or `-r` | No | The AWS region this function is located. Can use `AWS_DEFAULT_REGION` environment variable. Defaults to AWS session region. |
211
213
  | `--nr-api-key` or `-k` | No | Your [New Relic User API Key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#user-api-key). Can also use the `NEW_RELIC_API_KEY` environment variable. Only used if `--enable-extension` is set and there is no New Relic license key in AWS Secrets Manager. |
214
+ | `--nr-ingest-key`| No | Your [New Relic Ingest License Key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#personal-api-key). Can be used without `--enable-extension` configured or license key in AWS Secrets Manager. |
212
215
  | `--nr-region` | No | The New Relic region to use for the integration. Can use the `NEW_RELIC_REGION` environment variable. Can be either `eu` or `us`. Defaults to `us`. Only used if `--enable-extension` is set and there is no New Relic license key in AWS Secrets Manager. |
213
216
  | `--nr-env-delimite` | No | Set `NR_ENV_DELIMITER` environment variable for your Lambda Function |
214
217
  | `--nr-tags` | No | Set `NR_TAGS` environment variable for your Lambda Function |
@@ -1,29 +1,29 @@
1
1
  newrelic_lambda_cli/__init__.py,sha256=u4cy7hwbrNjK3xtldGQD_51aoNgSqGQ3IzFYsuvaIM4,149
2
- newrelic_lambda_cli/api.py,sha256=-lRsWBNO0YWV2yHp-zUbS2vs4AYJCn9yJngOrKAvmuo,15133
2
+ newrelic_lambda_cli/api.py,sha256=eBGq-IV73urdqhAA2xsIdf772q0npMiuRCCiCJgS10Q,15287
3
3
  newrelic_lambda_cli/apm.py,sha256=ZGEdmRW8jlJOl17TnTO716dwxpDSvEb5_28K6XadPDA,12475
4
4
  newrelic_lambda_cli/cliutils.py,sha256=XDtvTlgbf2uVg01yCJrfJmmgxbF0nIL9x58ETyvefk8,685
5
5
  newrelic_lambda_cli/functions.py,sha256=p57ZUw424BaSUA_Gw8DrYsJOYKROEHEaXgARadqwcP0,2800
6
6
  newrelic_lambda_cli/integrations.py,sha256=r0gxfEqVHTGu3xbr4dOCDwm0-Yhoz3KntfeQRWvoWrQ,31266
7
- newrelic_lambda_cli/layers.py,sha256=pyTbSCwJ2A3KP6YZiN-bkzt210UEj3j6dVnIFgijxWo,20339
7
+ newrelic_lambda_cli/layers.py,sha256=BL7XPMw8zal0UL5nrgDJMknfnhwSkp_LKVkBThWx_do,20673
8
8
  newrelic_lambda_cli/otel_ingestions.py,sha256=vi1Mlfc9nRvRWV7STwK7fDXZGozG8ufKohmpHcaWGic,9250
9
9
  newrelic_lambda_cli/permissions.py,sha256=H7v5IMpKaJIWC4Dff2YcTis4BKAAFIJr9IHWUj1LnF4,9093
10
10
  newrelic_lambda_cli/subscriptions.py,sha256=-BYkltqiDLdmhUB_Ot4w-5vvrKcQC6aHcTBLl1mlUlI,9564
11
- newrelic_lambda_cli/types.py,sha256=ln3fpVpV9FyHtRvDd68xT72zWTwCV6SixXhANGMGY3Q,3803
12
- newrelic_lambda_cli/utils.py,sha256=_XU5tFx9SxEzvp_brFFQtspBz_qoUZ2H_HDxhB_Qr1U,5902
11
+ newrelic_lambda_cli/types.py,sha256=MC22Gw5u97qcpjLrmExST_2uXSH7qceDEmdMziOslh4,3815
12
+ newrelic_lambda_cli/utils.py,sha256=ai_MRf6LH8-qWY18NawZBI670FWqA1fpkI1Eae4L91M,6130
13
13
  newrelic_lambda_cli/cli/__init__.py,sha256=vY8EdoHeI5r8DY_zELWMb2hCkm_p6oae6JYPweOq1d4,655
14
14
  newrelic_lambda_cli/cli/apm.py,sha256=gISzrUQ7a_QqOmReRGaTdpW1INIpAjPauBbqNt1vuNM,3510
15
15
  newrelic_lambda_cli/cli/decorators.py,sha256=a3agkVfy8omkUSL4aKblwSX95xtxYOGASULDYcJDPHk,1786
16
16
  newrelic_lambda_cli/cli/functions.py,sha256=RSh2Cowe1_oQup8q5YRidp03z-BITo2uzvDh4zvLr4I,2601
17
17
  newrelic_lambda_cli/cli/integrations.py,sha256=aQAWcCCU2kBmbF8fLKwKB9bzSY0uipvnojajjTkhqEs,10461
18
- newrelic_lambda_cli/cli/layers.py,sha256=LM_vMHcfFAjSCtnaH34P0Jn1ixY07s93EzOBsEgRQK0,7584
18
+ newrelic_lambda_cli/cli/layers.py,sha256=iZ6FBvAXeo-WC48E-bgerMx3JAY_AUCI4BL5Raop6sU,7719
19
19
  newrelic_lambda_cli/cli/otel_ingestions.py,sha256=4rTm9iYUo2qdMeqxJSrYLCA6ZXHy5bJnjDn9x54pCYc,6096
20
20
  newrelic_lambda_cli/cli/subscriptions.py,sha256=bUupv5iv3mUkC8t31nnI3BahoKxDnUJ8Rgq4QHJcFNU,5890
21
21
  newrelic_lambda_cli/templates/import-template.yaml,sha256=0r1yeoqpnqtEMggWomALkPG10NiANPWWBqz03rChch8,3771
22
22
  newrelic_lambda_cli/templates/license-key-secret.yaml,sha256=ZldQaLXsyF1K2I4X_AsLdH7kRmLkPUYI3talmhqQyHg,1849
23
23
  newrelic_lambda_cli/templates/nr-lambda-integration-role.yaml,sha256=s7T73B_k-mAwgzJrD2xn8YGUNgn2E1V7Exifrl81ViU,2874
24
- newrelic_lambda_cli-0.9.14.dist-info/licenses/LICENSE,sha256=uuxDzQm0yfq_tNZX0tQYzsZUVRIF0jm3dBLZUojSYzI,11345
25
- newrelic_lambda_cli-0.9.14.dist-info/METADATA,sha256=tw0SCoEnLxLdkPJmQTgvXg32vR3BXxm7RdNB84O9BP8,28949
26
- newrelic_lambda_cli-0.9.14.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
27
- newrelic_lambda_cli-0.9.14.dist-info/entry_points.txt,sha256=iks2k9Y4WNgIecsDzreIvMV9pGCjwwKTf33LKKvl2A8,65
28
- newrelic_lambda_cli-0.9.14.dist-info/top_level.txt,sha256=dxX2w58VgSUFiPD8C_lFuY-T2C1kjfeY0xi8iTh0r44,20
29
- newrelic_lambda_cli-0.9.14.dist-info/RECORD,,
24
+ newrelic_lambda_cli-0.9.16.dist-info/licenses/LICENSE,sha256=uuxDzQm0yfq_tNZX0tQYzsZUVRIF0jm3dBLZUojSYzI,11345
25
+ newrelic_lambda_cli-0.9.16.dist-info/METADATA,sha256=lmHrs1MvkYHb_EKYPIOxy6sp2ecj1dzw6h5JugTNXi4,29439
26
+ newrelic_lambda_cli-0.9.16.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
27
+ newrelic_lambda_cli-0.9.16.dist-info/entry_points.txt,sha256=iks2k9Y4WNgIecsDzreIvMV9pGCjwwKTf33LKKvl2A8,65
28
+ newrelic_lambda_cli-0.9.16.dist-info/top_level.txt,sha256=dxX2w58VgSUFiPD8C_lFuY-T2C1kjfeY0xi8iTh0r44,20
29
+ newrelic_lambda_cli-0.9.16.dist-info/RECORD,,