Using the encryption sdk within lambda

0

Hi,
I am trying to use the aws encryption sdk within a lambda, however i am getting multiple errors when attempting to do so.
Is there a guide which shows you how to import the requisite libraries into a lambda function ?

  • I know this is an old thread but for anyone who is wanting to do this using node.js do the following: create a dicrectory called nodejs. CD into the nodejs directory. Then npm init -y Then npm install '@aws-crypto/client-node Then cd out of the nodejs directory and zip the nodejs directory and call the file nodejs.zip.

    Next go to AWS Lambda and select layers, add new layer. Name it aws-crypto and upload your nodejs.zip file.

    In your lambda function add the aws-crypto layer you just created to your function.

    in your index.js include: require('@aws-crypto/client-node');

AshishP
asked 4 years ago2565 views
2 Answers
0
Accepted Answer

Hi,

Instructions for how to include libraries with your lambda function are available in the aws documentation:

Java: https://docs.aws.amazon.com/lambda/latest/dg/java-package.html
Python: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html
Nodejs: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-package.html

You should be able to include the AWS Encryption SDK in your lambda by following the instructions for your language.

AWS
answered 4 years ago
0

I was having issues while preparing a deployment package for lambda. When I was zipping the requisite libraries some files which were hidden within the sub directories were being skipped and this was causing issues because the deployment package was essentially incomplete.

AshishP
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions