cdk-lambda-extensions
TypeScript icon, indicating that this package has built-in type declarations

0.1.279 • Public • Published

NPM version PyPI version Release

cdk-lambda-extensions

AWS CDK construct library that allows you to add any AWS Lambda Extensions to the Lambda functions.

Sample

To add s3-logs-extension-demo extension from the aws-lambda-extensions github repository:

// prepare the s3 bucket for the lambda logs
const bucket = new s3.Bucket(this, 'DemoBucket');

// prepare the Function
const fn = new Function(this, 'Handler', {
  code: lambda.Code.fromAsset(path.join(__dirname,
    '../aws-lambda-extensions/s3-logs-extension-demo/functionsrc')),
  runtime: lambda.Runtime.PYTHON_3_8,
  handler: 'lambda_function.lambda_handler',
  memorySize: 128,
  environment: {
    S3_BUCKET_NAME: bucket.bucketName,
  },
});
bucket.grantWrite(fn);

// plug the `s3-logs-extension` in the lambda function
fn.addExtension(new S3LogsExtension(this, 'S3BucketExtention').extension);

Readme

Keywords

Package Sidebar

Install

npm i cdk-lambda-extensions

Weekly Downloads

280

Version

0.1.279

License

Apache-2.0

Unpacked Size

73.2 kB

Total Files

13

Last publish

Collaborators

  • pahud