@bifravst/aws-cdk-lambda-helpers 1.1.1 → 1.2.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/dist/LambdaLogGroup.d.ts +6 -0
- package/dist/LambdaLogGroup.js +16 -0
- package/dist/cdk.d.ts +2 -0
- package/dist/cdk.js +2 -0
- package/package.json +7 -1
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Construct } from 'constructs';
|
2
|
+
import { aws_logs as Logs, Names, RemovalPolicy, Stack } from 'aws-cdk-lib';
|
3
|
+
export class LambdaLogGroup extends Construct {
|
4
|
+
logGroup;
|
5
|
+
constructor(parent, id, retention = Logs.RetentionDays.ONE_DAY) {
|
6
|
+
super(parent, id);
|
7
|
+
this.logGroup = new Logs.LogGroup(this, 'logGroup', {
|
8
|
+
retention,
|
9
|
+
logGroupName: `/${Stack.of(this).stackName}/fn/${id}-${Names.uniqueId(this)}`,
|
10
|
+
logGroupClass: Logs.LogGroupClass.STANDARD, // INFREQUENT_ACCESS does not support custom metrics
|
11
|
+
removalPolicy: this.node.getContext('isTest') === true
|
12
|
+
? RemovalPolicy.DESTROY
|
13
|
+
: RemovalPolicy.RETAIN,
|
14
|
+
});
|
15
|
+
}
|
16
|
+
}
|
package/dist/cdk.d.ts
ADDED
package/dist/cdk.js
ADDED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@bifravst/aws-cdk-lambda-helpers",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.2.0",
|
4
4
|
"description": "Helper functions which simplify working with TypeScript lambdas for AWS CDK.",
|
5
5
|
"exports": {
|
6
6
|
".": {
|
@@ -20,6 +20,12 @@
|
|
20
20
|
"types": "./dist/util.d.ts",
|
21
21
|
"default": "./dist/util.js"
|
22
22
|
}
|
23
|
+
},
|
24
|
+
"./cdk": {
|
25
|
+
"import": {
|
26
|
+
"types": "./dist/cdk.d.ts",
|
27
|
+
"default": "./dist/cdk.js"
|
28
|
+
}
|
23
29
|
}
|
24
30
|
},
|
25
31
|
"type": "module",
|