@bifravst/aws-cdk-lambda-helpers 1.1.2 → 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.
@@ -0,0 +1,6 @@
1
+ import { Construct } from 'constructs';
2
+ import { aws_logs as Logs } from 'aws-cdk-lib';
3
+ export declare class LambdaLogGroup extends Construct {
4
+ readonly logGroup: Logs.LogGroup;
5
+ constructor(parent: Construct, id: string, retention?: Logs.RetentionDays);
6
+ }
@@ -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 CHANGED
@@ -1 +1,2 @@
1
1
  export * from './LambdaSource.js';
2
+ export * from './LambdaLogGroup.js';
package/dist/cdk.js CHANGED
@@ -1 +1,2 @@
1
1
  export * from './LambdaSource.js';
2
+ export * from './LambdaLogGroup.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bifravst/aws-cdk-lambda-helpers",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "description": "Helper functions which simplify working with TypeScript lambdas for AWS CDK.",
5
5
  "exports": {
6
6
  ".": {