1.80.0 • Published 3 years ago

@myhelix-cdk/lambda v1.80.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

lambda

Helix's subclass of @aws-cdk/aws-lambda

Adds sumologic log forwarding, and add default monitors and alarms from @aws-cdk/monitoring

Helix Additions to lambda.Function

We extend lambda.Function with some extra props

  readonly sumoCollector?: boolean;
  readonly sumoEndpoint?: SumoEndpoint | string;
  readonly sourceCategory?: string;
  readonly sourceHostOverride?: string;

these can be passed in as props to the lambda...

import * as hlambda from '@myhelix-cdk/lambda';


lambdaFn = new hlambda.Function(this, 'Handler', {
  sumoCollector: true,
  functionName: myLambda,
  runtime: lambda.Runtime.GO_1_X,
  code: lambda.Code.asset(`../artifacts/${props.lambdaHandler}.zip`),
  handler: 'handler',
  environment: {SOME_VAR: "abc"},
  description: `lambda for my service`,
});

or you can use the addSumoCollector method

import * as hlambda from '@myhelix-cdk/lambda';


lambdaFn = new hlambda.Function(this, 'Handler', {
  functionName: myLambda,
  runtime: lambda.Runtime.GO_1_X,
  code: lambda.Code.asset(`../artifacts/${props.lambdaHandler}.zip`),
  handler: 'handler',
  environment: {SOME_VAR: "abc"},
  description: `lambda for my service`,
});

lambdaFn.addSumoCollector();