Navneet Thakur
Navneet Thakur

Reputation: 71

Unable to import module 'aws_encryption_sdk' from AWS Lambda function

I am trying to decrypt a file present in s3 bucket. I am using an AWS lambda function to do so.

Here the code that I want to execute using AWS Lambda (I'm using code entry type as Edit code inline):

import aws_encryption_sdk 

with aws_encryption_sdk.stream(
        mode='d',
        source=src_file,
        key_provider=kms_key
        ) as decryptor:
            for block in decryptor:
                tgt_file.write(block)

However, my AWS lambda function is failing with the error:

Unable to import module 'lambda_function': No module named aws_encryption_sdk

Isn't it possible to use aws_encryption_sdk in AWS Lambda? If it's possible, please guide me on how to use it.

Thanks in advance!

Upvotes: 0

Views: 2644

Answers (1)

mkrana
mkrana

Reputation: 430

This is external python package. aws lambda provides Python environments for different python versions however if you want to use any of the external packages you should be uploading the package as part of your function package, for more details referpython packages for aws lambda

Upvotes: 1

Related Questions