newrelic-lambda-cli 0.9.9__py2.py3-none-any.whl → 0.9.10__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.
@@ -370,11 +370,12 @@ def retrieve_license_key(gql):
370
370
  return __cached_license_key
371
371
  except Exception:
372
372
  raise click.BadParameter(
373
- "Could not retrieve license key from New Relic. Check that your New Relic "
374
- "Account ID is valid and try again.",
373
+ f"For New Relic Account ID: {gql.account_id}. "
374
+ "Could not retrieve INGEST - LICENSE key from New Relic. "
375
+ "Check that your New Relic Account ID and USER key are valid and try again.",
375
376
  ctx=None,
376
- param="nr_account_id",
377
- param_hint="New Relic Account ID",
377
+ param="nr_api_key",
378
+ param_hint="API Key",
378
379
  )
379
380
 
380
381
 
@@ -94,10 +94,42 @@ def register(group):
94
94
  help="Enable/disable the New Relic Lambda Extension",
95
95
  )
96
96
  @click.option(
97
- "--enable-extension-function-logs/--disable-extension-function-logs",
98
- default=False,
99
- show_default=True,
100
- help="Enable/disable sending Lambda function logs via the Extension",
97
+ "--send-extension-logs",
98
+ is_flag=True,
99
+ help="Enable sending extension logs via the New Relic Lambda Extension",
100
+ )
101
+ @click.option(
102
+ "--disable-extension-logs",
103
+ is_flag=True,
104
+ help="Disable sending extension logs via the New Relic Lambda Extension",
105
+ )
106
+ @click.option(
107
+ "--enable-extension-function-logs",
108
+ is_flag=True,
109
+ help="Enable sending Lambda function logs via the New Relic Lambda Extension",
110
+ )
111
+ @click.option(
112
+ "--disable-extension-function-logs",
113
+ is_flag=True,
114
+ help="Disable sending Lambda function logs via the New Relic Lambda Extension",
115
+ )
116
+ @click.option(
117
+ "--nr-tags",
118
+ help="Set NR_TAGS environment variable for Lambda (e.g. key1:value1;key2:value2)",
119
+ )
120
+ @click.option(
121
+ "--nr-env-delimiter",
122
+ help="Set NR_ENV_DELIMITER environment variable for Lambda (e.g. ',' for comma)",
123
+ )
124
+ @click.option(
125
+ "--send-function-logs",
126
+ is_flag=True,
127
+ help="Enable sending Lambda function logs via the New Relic Lambda Extension",
128
+ )
129
+ @click.option(
130
+ "--disable-function-logs",
131
+ is_flag=True,
132
+ help="Disable sending Lambda function logs via the New Relic Lambda Extension",
101
133
  )
102
134
  @click.option(
103
135
  "--java_handler_method",
@@ -18,6 +18,7 @@ from newrelic_lambda_cli.utils import catch_boto_errors
18
18
 
19
19
  NEW_RELIC_ENV_VARS = (
20
20
  "NEW_RELIC_ACCOUNT_ID",
21
+ "NEW_RELIC_EXTENSION_SEND_EXTENSION_LOGS",
21
22
  "NEW_RELIC_EXTENSION_SEND_FUNCTION_LOGS",
22
23
  "NEW_RELIC_LAMBDA_EXTENSION_ENABLED",
23
24
  "NEW_RELIC_LAMBDA_HANDLER",
@@ -25,6 +26,8 @@ NEW_RELIC_ENV_VARS = (
25
26
  "NEW_RELIC_LOG_ENDPOINT",
26
27
  "NEW_RELIC_TELEMETRY_ENDPOINT",
27
28
  "NEW_RELIC_APM_LAMBDA_MODE",
29
+ "NR_TAGS",
30
+ "NR_ENV_DELIMITER",
28
31
  )
29
32
 
30
33
 
@@ -201,10 +204,52 @@ def _add_new_relic(input, config, nr_license_key):
201
204
  "NEW_RELIC_LAMBDA_EXTENSION_ENABLED"
202
205
  ] = "true"
203
206
 
204
- update_kwargs["Environment"]["Variables"][
205
- "NEW_RELIC_EXTENSION_SEND_FUNCTION_LOGS"
206
- ] = ("true" if input.enable_extension_function_logs else "false")
207
+ if not input.upgrade:
208
+ update_kwargs["Environment"]["Variables"][
209
+ "NEW_RELIC_EXTENSION_SEND_FUNCTION_LOGS"
210
+ ] = "false"
211
+ elif input.enable_extension_function_logs or input.send_function_logs:
212
+ update_kwargs["Environment"]["Variables"][
213
+ "NEW_RELIC_EXTENSION_SEND_FUNCTION_LOGS"
214
+ ] = "true"
215
+ success(
216
+ "Successfully enabled NEW_RELIC_EXTENSION_SEND_FUNCTION_LOGS tag to the function"
217
+ )
218
+ elif input.disable_extension_function_logs or input.disable_function_logs:
219
+ update_kwargs["Environment"]["Variables"][
220
+ "NEW_RELIC_EXTENSION_SEND_FUNCTION_LOGS"
221
+ ] = "false"
222
+ success(
223
+ "Successfully disabled NEW_RELIC_EXTENSION_SEND_FUNCTION_LOGS tag to the function"
224
+ )
207
225
 
226
+ if not input.upgrade:
227
+ update_kwargs["Environment"]["Variables"][
228
+ "NEW_RELIC_EXTENSION_SEND_EXTENSION_LOGS"
229
+ ] = "false"
230
+ elif input.send_extension_logs:
231
+ update_kwargs["Environment"]["Variables"][
232
+ "NEW_RELIC_EXTENSION_SEND_EXTENSION_LOGS"
233
+ ] = "true"
234
+ success(
235
+ "Successfully enabled NEW_RELIC_EXTENSION_SEND_EXTENSION_LOGS tag to the function"
236
+ )
237
+ elif input.disable_extension_logs:
238
+ update_kwargs["Environment"]["Variables"][
239
+ "NEW_RELIC_EXTENSION_SEND_EXTENSION_LOGS"
240
+ ] = "false"
241
+ success(
242
+ "Successfully disabled NEW_RELIC_EXTENSION_SEND_EXTENSION_LOGS tag to the function"
243
+ )
244
+
245
+ if input.nr_tags:
246
+ update_kwargs["Environment"]["Variables"]["NR_TAGS"] = input.nr_tags
247
+ success("Successfully added NR_TAGS tag to the function")
248
+ if input.nr_env_delimiter:
249
+ update_kwargs["Environment"]["Variables"][
250
+ "NR_ENV_DELIMITER"
251
+ ] = input.nr_env_delimiter
252
+ success("Successfully added NR_ENV_DELIMITER tag to the function")
208
253
  if input.nr_region == "staging":
209
254
  update_kwargs["Environment"]["Variables"][
210
255
  "NEW_RELIC_TELEMETRY_ENDPOINT"
@@ -107,6 +107,13 @@ LAYER_INSTALL_KEYS = [
107
107
  "apm",
108
108
  "enable_extension",
109
109
  "enable_extension_function_logs",
110
+ "disable_extension_function_logs",
111
+ "nr_tags",
112
+ "nr_env_delimiter",
113
+ "send_function_logs",
114
+ "disable_function_logs",
115
+ "send_extension_logs",
116
+ "disable_extension_logs",
110
117
  "java_handler_method",
111
118
  "esm",
112
119
  ]
@@ -187,7 +187,9 @@ def parse_arn(arn):
187
187
  result["resource"] = elements[5]
188
188
  result["resourcetype"] = None
189
189
  else:
190
- result["resourcetype"], result["resource"] = elements[5].split("/")
190
+ splitted_arn = elements[5].split("/")
191
+ result["resourcetype"] = splitted_arn[0]
192
+ result["resource"] = "/".join(splitted_arn[1:])
191
193
  return result
192
194
 
193
195
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: newrelic-lambda-cli
3
- Version: 0.9.9
3
+ Version: 0.9.10
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
@@ -126,6 +126,9 @@ newrelic-lambda integrations install \
126
126
  | `--nr-api-key` or `-k` | Yes | 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. |
127
127
  | `--linked-account-name` or `-n` | No | A label for the New Relic Linked Account. This is how this integration will appear in New Relic. Defaults to "New Relic Lambda Integration - <AWS Account ID>". |
128
128
  | `--enable-logs` or `-e` | No | Enables forwarding logs to New Relic Logging. This is disabled by default. Make sure you run `newrelic-lambda subscriptions install --function ... --filter-pattern ""` afterwards. |
129
+ | `--enable-license-key-secret` | No | Securely manages and store your New Relic license key in `AWS Secrets Manager` |
130
+ | `--enable-cw-ingest` | No | Enable the CloudWatch `log ingest` function |
131
+ | `--disable-cw-ingest` | No | Disable the CloudWatch `log ingest` function |
129
132
  | `--memory-size` or `-m` | No | Memory size (in MiB) for the New Relic log ingestion function. Default to 128MB. |
130
133
  | `--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`. |
131
134
  | `--timeout` or `-t` | No | Timeout (in seconds) for the New Relic log ingestion function. Defaults to 30 seconds. |
@@ -171,6 +174,7 @@ newrelic-lambda integrations update \
171
174
  | `--disable-logs` or `-d` | No | Disables forwarding logs to New Relic Logging. Make sure you run `newrelic-lambda subscriptions install --function ...` afterwards. |
172
175
  | `--enable-logs` or `-e` | No | Enables forwarding logs to New Relic Logging. Make sure you run `newrelic-lambda subscriptions install --function ... --filter-pattern ""` afterwards. |
173
176
  | `--memory-size` or `-m` | No | Memory size (in MiB) for the New Relic log ingestion function. |
177
+ | `--enable-license-key-secret` | No | Securely manages and store your New Relic license key in `AWS Secrets Manager` |
174
178
  | `--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`. |
175
179
  | `--timeout` or `-t` | No | Timeout (in seconds) for the New Relic log ingestion function. |
176
180
  | `--role-name` | No | Role name for the ingestion function. If you prefer to create and manage an IAM role for the function to assume out of band, do so and specify that role's name here. This avoids needing CAPABILITY_IAM. |
@@ -198,11 +202,16 @@ newrelic-lambda layers install \
198
202
  | `--layer-arn` or `-l` | No | Specify a specific layer version ARN to use. This is auto detected by default. |
199
203
  | `--upgrade` or `-u` | No | Permit upgrade to the latest layer version for this region and runtime. |
200
204
  | `--disable-extension` | No | Disable the [New Relic Lambda Extension](https://github.com/newrelic/newrelic-lambda-extension). |
201
- | `--enable-extension-function-logs` | No | Enable forwarding logs via the [New Relic Lambda Extension](https://github.com/newrelic/newrelic-lambda-extension). Disabled by default. |
205
+ | `--enable-extension-function-logs` or `--send-function-logs` | No | Enable sending Lambda function logs via the [New Relic Lambda Extension](https://github.com/newrelic/newrelic-lambda-extension). Disabled by default. |
206
+ | `--disable-extension-function-logs` or `--disable-function-logs` | No | Disable sending Lambda function logs via the [New Relic Lambda Extension](https://github.com/newrelic/newrelic-lambda-extension).|
207
+ | `--send-extension-logs` | No | Enable forwarding logs via the [New Relic Lambda Extension](https://github.com/newrelic/newrelic-lambda-extension). Disabled by default. |
208
+ | `--disable-extension-logs` | No | Disable forwarding logs via the [New Relic Lambda Extension](https://github.com/newrelic/newrelic-lambda-extension).|
202
209
  | `--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. |
203
210
  | `--aws-region` or `-r` | No | The AWS region this function is located. Can use `AWS_DEFAULT_REGION` environment variable. Defaults to AWS session region. |
204
211
  | `--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. |
205
212
  | `--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
+ | `--nr-env-delimite` | No | Set `NR_ENV_DELIMITER` environment variable for your Lambda Function |
214
+ | `--nr-tags` | No | Set `NR_TAGS` environment variable for your Lambda Function |
206
215
  | `--java_handler_method` or `-j` | No | For java runtimes only to specify an aws implementation method. Defaults to RequestHandler. Optional inputs are: handleRequest, handleStreamsRequest `--java_handler_method handleStreamsRequest`. |
207
216
  | `--esm` | No | For Node.js functions using ES Modules (ESM), enable the specific ESM wrapper during installation (e.g., using the --esm flag). This sets the Lambda handler to `/opt/nodejs/node_modules/newrelic-esm-lambda-wrapper/index.handler`. |
208
217
 
@@ -1,27 +1,27 @@
1
1
  newrelic_lambda_cli/__init__.py,sha256=u4cy7hwbrNjK3xtldGQD_51aoNgSqGQ3IzFYsuvaIM4,149
2
- newrelic_lambda_cli/api.py,sha256=b75XwylRhW9pcA6aZ9EjBW1yIFOGHhhULDD5hNhMyes,15065
2
+ newrelic_lambda_cli/api.py,sha256=U3fqFs_fSSlVJ3CSF2SmY-Sm-rwJDusY0usK1iMjxx4,15132
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=h-oZu8LiKmc6DXNhP2LlP6Uy9mxY_eHlIKUNQqx1IZ0,17075
6
+ newrelic_lambda_cli/layers.py,sha256=F21P8JZJy-R56rf9hTLvTvxMHw2zDuJyoUnZDgQryeA,19062
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=7c9YIkOlU0ZDgs6yZLHVDEdOeeV-fk3EkuuqRKqqAp8,3315
11
- newrelic_lambda_cli/utils.py,sha256=mtjhu0DEWOugS6-dS2u9cTSb6oC1TaQze_hFTrbi4Nk,5827
10
+ newrelic_lambda_cli/types.py,sha256=OVu8Ybls5XZdzb9wsuLbkCrf4q2wkLIEgiOlkGODLWY,3505
11
+ newrelic_lambda_cli/utils.py,sha256=_XU5tFx9SxEzvp_brFFQtspBz_qoUZ2H_HDxhB_Qr1U,5902
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=6eWN9yYaL8aZAWXn10MoPe6mH1_hPt8Q5fJ8Zc9oEYM,6454
16
+ newrelic_lambda_cli/cli/layers.py,sha256=xIbunW2p03sAzcgfiD_OSBAvBWkqys9iDwMl4IezY1k,7397
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.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,,
22
+ newrelic_lambda_cli-0.9.10.dist-info/licenses/LICENSE,sha256=uuxDzQm0yfq_tNZX0tQYzsZUVRIF0jm3dBLZUojSYzI,11345
23
+ newrelic_lambda_cli-0.9.10.dist-info/METADATA,sha256=25IfnT2AFWRLZxRARmDhM7zgUV2QzusEWZUG75QIL8s,28715
24
+ newrelic_lambda_cli-0.9.10.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
25
+ newrelic_lambda_cli-0.9.10.dist-info/entry_points.txt,sha256=iks2k9Y4WNgIecsDzreIvMV9pGCjwwKTf33LKKvl2A8,65
26
+ newrelic_lambda_cli-0.9.10.dist-info/top_level.txt,sha256=dxX2w58VgSUFiPD8C_lFuY-T2C1kjfeY0xi8iTh0r44,20
27
+ newrelic_lambda_cli-0.9.10.dist-info/RECORD,,