You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

martinweiss's avatar
martinweiss
New member | Level 2
2 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.

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

    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

    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.5,918 PostsLatest Activity: 2 days ago
334 Following

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!