@beesolve/lambda-keep-active 1.2.0 → 1.3.0

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.
package/.jsii CHANGED
@@ -8,8 +8,8 @@
8
8
  ]
9
9
  },
10
10
  "dependencies": {
11
- "aws-cdk-lib": "^2.231.0",
12
- "constructs": "^10.4.3"
11
+ "aws-cdk-lib": "^2.235.1",
12
+ "constructs": "^10.4.5"
13
13
  },
14
14
  "dependencyClosure": {
15
15
  "@aws-cdk/asset-awscli-v1": {
@@ -642,6 +642,19 @@
642
642
  }
643
643
  }
644
644
  },
645
+ "aws-cdk-lib.aws_cases": {
646
+ "targets": {
647
+ "dotnet": {
648
+ "namespace": "Amazon.CDK.AWS.Cases"
649
+ },
650
+ "java": {
651
+ "package": "software.amazon.awscdk.services.cases"
652
+ },
653
+ "python": {
654
+ "module": "aws_cdk.aws_cases"
655
+ }
656
+ }
657
+ },
645
658
  "aws-cdk-lib.aws_cassandra": {
646
659
  "targets": {
647
660
  "dotnet": {
@@ -1202,6 +1215,19 @@
1202
1215
  }
1203
1216
  }
1204
1217
  },
1218
+ "aws-cdk-lib.aws_devopsagent": {
1219
+ "targets": {
1220
+ "dotnet": {
1221
+ "namespace": "Amazon.CDK.AWS.DevOpsAgent"
1222
+ },
1223
+ "java": {
1224
+ "package": "software.amazon.awscdk.services.devopsagent"
1225
+ },
1226
+ "python": {
1227
+ "module": "aws_cdk.aws_devopsagent"
1228
+ }
1229
+ }
1230
+ },
1205
1231
  "aws-cdk-lib.aws_devopsguru": {
1206
1232
  "targets": {
1207
1233
  "dotnet": {
@@ -4593,6 +4619,22 @@
4593
4619
  }
4594
4620
  }
4595
4621
  },
4622
+ "aws-cdk-lib.interfaces.aws_cases": {
4623
+ "targets": {
4624
+ "dotnet": {
4625
+ "namespace": "Amazon.CDK.Interfaces.Cases"
4626
+ },
4627
+ "go": {
4628
+ "packageName": "interfacesawscases"
4629
+ },
4630
+ "java": {
4631
+ "package": "software.amazon.awscdk.interfaces.cases"
4632
+ },
4633
+ "python": {
4634
+ "module": "aws_cdk.interfaces.aws_cases"
4635
+ }
4636
+ }
4637
+ },
4596
4638
  "aws-cdk-lib.interfaces.aws_cassandra": {
4597
4639
  "targets": {
4598
4640
  "dotnet": {
@@ -5217,6 +5259,22 @@
5217
5259
  }
5218
5260
  }
5219
5261
  },
5262
+ "aws-cdk-lib.interfaces.aws_devopsagent": {
5263
+ "targets": {
5264
+ "dotnet": {
5265
+ "namespace": "Amazon.CDK.Interfaces.DevOpsAgent"
5266
+ },
5267
+ "go": {
5268
+ "packageName": "interfacesawsdevopsagent"
5269
+ },
5270
+ "java": {
5271
+ "package": "software.amazon.awscdk.interfaces.devopsagent"
5272
+ },
5273
+ "python": {
5274
+ "module": "aws_cdk.interfaces.aws_devopsagent"
5275
+ }
5276
+ }
5277
+ },
5220
5278
  "aws-cdk-lib.interfaces.aws_devopsguru": {
5221
5279
  "targets": {
5222
5280
  "dotnet": {
@@ -8412,7 +8470,7 @@
8412
8470
  "stability": "stable"
8413
8471
  },
8414
8472
  "homepage": "https://github.com/beesolve/lambda-keep-active",
8415
- "jsiiVersion": "5.9.14 (build 9fc28bd)",
8473
+ "jsiiVersion": "5.9.23 (build 29252a0)",
8416
8474
  "keywords": [
8417
8475
  "active",
8418
8476
  "aws",
@@ -8430,7 +8488,7 @@
8430
8488
  },
8431
8489
  "name": "@beesolve/lambda-keep-active",
8432
8490
  "readme": {
8433
- "markdown": "# Lambda Keep Active\n\n[![View on Construct Hub](https://constructs.dev/badge?package=%40beesolve%2Flambda-keep-active)](https://constructs.dev/packages/@beesolve/lambda-keep-active)\n\n> A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated. If Lambda fails to recreate the resources, the function returns to the inactive state. You might need to resolve any errors and redeploy your function to restore it to the active state.\n>\n> [Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\n\nWhenever your Lambda function becames `inactive` waking it up might take up to 90 seconds as per [this article](https://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/).\n\nIn order to avoid your Lambda functions to transition to `inactive` state you should invoke them periodically.\n\nNo-one really knows what the \"long enough\" actually means but there is [general consenzus](https://stackoverflow.com/questions/77584016/how-long-before-idle-lambda-function-transitions-to-inactive-state/77691745#77691745) that it might be around 14 days.\n\nAt BeeSolve we are invoking our Lambda functions every 3 days in order to be sure they won't transition to `inactive` state.\n\n## Installation\n\nYou can install Lambda Keep Active helper through npm or any other npm compatible package manager:\n\n```bash\nnpm i @beesolve/lambda-keep-active\n```\n\n## Usage\n\n```ts\n// stack.ts\nimport { LambdaKeepActive } from \"@beesolve/lambda-keep-active\";\n\nconst warmer = new LambdaKeepActive(this, \"KeepAliveLambda\");\n\nconst handler = new NodejsFunction(this, 'Handler', { /** your props */});\n\nwarmer.keepActive(handler);\n```\n\nFor Node.js Lambda handlers you can use `keptActive` wrapper like this:\n\n```ts\n// handler.ts\nimport { keptActive } from \"@beesolve/lambda-keep-active\";\n\nexport const handler = keptActive(async () => {\n // your handler code\n});\n```\n\nFor [Bun Lambda handlers](https://github.com/BeeSolve/lambda-bun-runtime) you can use `keptActiveFetch` wrapper like this:\n\n```ts\n// bunHandler.ts\nimport { keptActiveFetch } from \"@beesolve/lambda-keep-active\";\n\nexport default {\n fetch: keptActiveFetch(async (request: Request): Promise<Response> => {\n // your handler code\n return new Response();\n }),\n};\n```\n"
8491
+ "markdown": "# Lambda Keep Active\n\n[![View on Construct Hub](https://constructs.dev/badge?package=%40beesolve%2Flambda-keep-active)](https://constructs.dev/packages/@beesolve/lambda-keep-active)\n\n> A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated. If Lambda fails to recreate the resources, the function returns to the inactive state. You might need to resolve any errors and redeploy your function to restore it to the active state.\n>\n> [Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\n\nWhenever your Lambda function becames `inactive` waking it up might take up to 90 seconds as per [this article](https://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/).\n\nIn order to avoid your Lambda functions to transition to `inactive` state you should invoke them periodically.\n\nNo-one really knows what the \"long enough\" actually means but there is [general consenzus](https://stackoverflow.com/questions/77584016/how-long-before-idle-lambda-function-transitions-to-inactive-state/77691745#77691745) that it might be around 14 days.\n\nAt BeeSolve we are invoking our Lambda functions every 3 days in order to be sure they won't transition to `inactive` state.\n\n## Installation\n\nYou can install Lambda Keep Active helper through npm or any other npm compatible package manager:\n\n```bash\nnpm i @beesolve/lambda-keep-active\n```\n\n## Usage\n\n```ts\n// stack.ts\nimport { LambdaKeepActive } from \"@beesolve/lambda-keep-active\";\n\nconst warmer = new LambdaKeepActive(this, \"KeepAliveLambda\");\n\nconst handler = new NodejsFunction(this, 'Handler', { /** your props */});\n\nwarmer.keepActive(handler);\n```\n\nFor Node.js Lambda handlers you can use `keptActive` wrapper like this:\n\n```ts\n// handler.ts\nimport { keptActive } from \"@beesolve/lambda-keep-active/runtime\";\n\nexport const handler = keptActive(async () => {\n // your handler code\n});\n```\n\nFor [Bun Lambda handlers](https://github.com/BeeSolve/lambda-bun-runtime) you can use `keptActiveFetch` wrapper like this:\n\n```ts\n// bunHandler.ts\nimport { keptActiveFetch } from \"@beesolve/lambda-keep-active/runtime\";\n\nexport default {\n fetch: keptActiveFetch(async (request: Request): Promise<Response> => {\n // your handler code\n return new Response();\n }),\n};\n```\n"
8434
8492
  },
8435
8493
  "repository": {
8436
8494
  "type": "git",
@@ -8456,7 +8514,7 @@
8456
8514
  },
8457
8515
  "locationInModule": {
8458
8516
  "filename": "src/cdk.ts",
8459
- "line": 20
8517
+ "line": 32
8460
8518
  },
8461
8519
  "parameters": [
8462
8520
  {
@@ -8483,7 +8541,7 @@
8483
8541
  "kind": "class",
8484
8542
  "locationInModule": {
8485
8543
  "filename": "src/cdk.ts",
8486
- "line": 19
8544
+ "line": 31
8487
8545
  },
8488
8546
  "methods": [
8489
8547
  {
@@ -8492,7 +8550,7 @@
8492
8550
  },
8493
8551
  "locationInModule": {
8494
8552
  "filename": "src/cdk.ts",
8495
- "line": 54
8553
+ "line": 71
8496
8554
  },
8497
8555
  "name": "keepActive",
8498
8556
  "parameters": [
@@ -8518,7 +8576,7 @@
8518
8576
  "kind": "interface",
8519
8577
  "locationInModule": {
8520
8578
  "filename": "src/cdk.ts",
8521
- "line": 10
8579
+ "line": 11
8522
8580
  },
8523
8581
  "name": "LambdaKeepActiveProps",
8524
8582
  "properties": [
@@ -8532,18 +8590,36 @@
8532
8590
  "immutable": true,
8533
8591
  "locationInModule": {
8534
8592
  "filename": "src/cdk.ts",
8535
- "line": 16
8593
+ "line": 17
8536
8594
  },
8537
8595
  "name": "enableLogs",
8538
8596
  "optional": true,
8539
8597
  "type": {
8540
8598
  "primitive": "boolean"
8541
8599
  }
8600
+ },
8601
+ {
8602
+ "abstract": true,
8603
+ "docs": {
8604
+ "default": "{\n removalPolicy: RemovalPolicy.DESTROY,\n retention: RetentionDays.TWO_WEEKS\n}",
8605
+ "stability": "stable",
8606
+ "summary": "Adjusts logging for SQS handler."
8607
+ },
8608
+ "immutable": true,
8609
+ "locationInModule": {
8610
+ "filename": "src/cdk.ts",
8611
+ "line": 28
8612
+ },
8613
+ "name": "logGroupProps",
8614
+ "optional": true,
8615
+ "type": {
8616
+ "fqn": "aws-cdk-lib.aws_logs.LogGroupProps"
8617
+ }
8542
8618
  }
8543
8619
  ],
8544
8620
  "symbolId": "src/cdk:LambdaKeepActiveProps"
8545
8621
  }
8546
8622
  },
8547
- "version": "1.2.0",
8548
- "fingerprint": "rAXSXmARg8zRp5HBuL7ToXOkRYu21gJ5+Fc5SqmKVrY="
8623
+ "version": "1.3.0",
8624
+ "fingerprint": "5LjDZ2MO0kpk17Gk/dJStMKkJVCU+RRdJ+7pGM0Bhoc="
8549
8625
  }
package/API.md CHANGED
@@ -145,6 +145,7 @@ const lambdaKeepActiveProps: LambdaKeepActiveProps = { ... }
145
145
  | **Name** | **Type** | **Description** |
146
146
  | --- | --- | --- |
147
147
  | <code><a href="#@beesolve/lambda-keep-active.LambdaKeepActiveProps.property.enableLogs">enableLogs</a></code> | <code>boolean</code> | If disabled no logs are logged to CloudWatch. |
148
+ | <code><a href="#@beesolve/lambda-keep-active.LambdaKeepActiveProps.property.logGroupProps">logGroupProps</a></code> | <code>aws-cdk-lib.aws_logs.LogGroupProps</code> | Adjusts logging for SQS handler. |
148
149
 
149
150
  ---
150
151
 
@@ -161,5 +162,18 @@ If disabled no logs are logged to CloudWatch.
161
162
 
162
163
  ---
163
164
 
165
+ ##### `logGroupProps`<sup>Optional</sup> <a name="logGroupProps" id="@beesolve/lambda-keep-active.LambdaKeepActiveProps.property.logGroupProps"></a>
166
+
167
+ ```typescript
168
+ public readonly logGroupProps: LogGroupProps;
169
+ ```
170
+
171
+ - *Type:* aws-cdk-lib.aws_logs.LogGroupProps
172
+ - *Default:* { removalPolicy: RemovalPolicy.DESTROY, retention: RetentionDays.TWO_WEEKS }
173
+
174
+ Adjusts logging for SQS handler.
175
+
176
+ ---
177
+
164
178
 
165
179
 
package/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
 
2
+ ## [1.2.0](https://github.com/beesolve/lambda-keep-active/compare/v1.1.2...v1.2.0) (2025-12-16)
3
+
4
+
5
+ ### Features
6
+
7
+ * split runtime and cdk constructs ([b212fef](https://github.com/beesolve/lambda-keep-active/commit/b212fef5181c30c356ff679b40cafd17c438ae80))
8
+
2
9
  ## [1.1.2](https://github.com/beesolve/lambda-keep-active/compare/v1.1.1...v1.1.2) (2025-12-04)
3
10
 
4
11
  ## [1.1.1](https://github.com/beesolve/lambda-keep-active/compare/v1.1.0...v1.1.1) (2025-12-03)
@@ -10,4 +17,3 @@
10
17
 
11
18
  * change to projen ([2ed9a40](https://github.com/beesolve/lambda-keep-active/commit/2ed9a4040373b7353d4d8b08601151ceb2e8aa07))
12
19
  * fix config ([307d174](https://github.com/beesolve/lambda-keep-active/commit/307d1744a51f2f0dd5af18c653fa9cf51df27c6d))
13
-
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2025 BeeSolve s.r.o.
1
+ Copyright (c) 2026 BeeSolve s.r.o.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -39,7 +39,7 @@ For Node.js Lambda handlers you can use `keptActive` wrapper like this:
39
39
 
40
40
  ```ts
41
41
  // handler.ts
42
- import { keptActive } from "@beesolve/lambda-keep-active";
42
+ import { keptActive } from "@beesolve/lambda-keep-active/runtime";
43
43
 
44
44
  export const handler = keptActive(async () => {
45
45
  // your handler code
@@ -50,7 +50,7 @@ For [Bun Lambda handlers](https://github.com/BeeSolve/lambda-bun-runtime) you ca
50
50
 
51
51
  ```ts
52
52
  // bunHandler.ts
53
- import { keptActiveFetch } from "@beesolve/lambda-keep-active";
53
+ import { keptActiveFetch } from "@beesolve/lambda-keep-active/runtime";
54
54
 
55
55
  export default {
56
56
  fetch: keptActiveFetch(async (request: Request): Promise<Response> => {