Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester here.

Forum Discussion

martinweiss's avatar
martinweiss
New member | Level 2
3 years ago

Dropbox API and AWS Lambda

Hi,

I have a web app that is is taking files and uploading them to an S3 bucket. I have written a Lambda function to upload the files from the bucket to a Dropbox folder with the API. I tested it locally and it worked fine. I created a directory locally, added my script, used pip to install the Dropbox API, zipped those files, and upload the zip file to AWS. When I try to import Dropbox in my Python script on AWS, Dropbox can't be imported. This could be an AWS issue but I just want to check if the Dropbox API supports use with AWS Lambda.

 

Thanks.

2 Replies

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    3 years ago

    Hi martinweiss,

    Dropbox provides Python SDK, but doesn't support any particular work environment explicitly; it's your responsibility. As about AWS Lambda, you need to add in some way any non builtin features (including Dropbox SDK and all possible its non builtin dependencies). What is missing actually can be seen in the error message itself; what exactly can't be imported? 🧐 You can add missing code as part of the deployment package or as independent layer. Don't forget to associate corresponding layer with your Lambda if you select this way (it's preferable).

    Hope this gives direction.

     

    PS: Additional troubles can rise up if you don't ensure valid POSIX file attributes or (when binaries are distributed) incompatible Python version. Take care!

  • Scott-DB's avatar
    Scott-DB
    Icon for Dropbox Staff rankDropbox Staff
    3 years ago

    Hi martinweiss,

     

    The SDK should work on AWS; we don't explicitly test against it but it should work. Based on the steps you described, the SDK may not be installed in the directory that you are uploading. You may want to refer to AWS's steps for "Deployment package with dependencies" located here.

     

    Hope this helps!

    Scott

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,038 PostsLatest Activity: 3 hours ago
415 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!