s3到ftp服务器,而无需下载到ec2 [英] s3 to ftp server without downloading to ec2

查看:111
本文介绍了s3到ftp服务器,而无需下载到ec2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以(以编程方式)将文件从s3存储桶传输到外部ftp服务器,而无需将其下载到ec2实例?

Is there is way (programmatically) to transfer file from s3 bucket to an external ftp server without downloading it to an ec2 instance ?

更多详细信息:

  1. 我有一个运行在EC2上的Django服务器,该服务器提供有角度的Web应用程序.

  1. I have a Django server running on EC2 which serves an angular web app.

用户使用我的Web应用程序将文件上传到S3存储桶,一旦上传完成,Web应用程序将发送包含文件对象s3 url的POST请求.

User uploads a file to S3 bucket using my web app and once the upload is complete the web app sends a POST request containing the file object s3 url.

Django服务器在收到POST请求后 可能需要将文件(上传到s3)复制到外部ftp服务器.目标ftp服务器可能会有所不同,具体取决于上传文件的用户(每个用户组可能都有自己的ftp服务器).

The Django server upon receiving the POST request may need to copy the file (uploaded to s3) to an external ftp server. The target ftp server may be different depending upon the user who uploaded the file (each user group may have her own ftp server).

我了解到,收到POST请求后,Django服务器可以从s3下载文件,然后将其上传到适当的目标ftp服务器.

I understand that upon receiving POST request, Django server can download the file from s3 and then upload it to the appropriate target ftp server.

我的问题是:我可以通过某种方式启动从s3到目标ftp服务器的传输并在该传输完成时(成功或错误)获得回调/通知来减少步骤4中EC2实例的开销.

My question is: Can I reduce overhead on my EC2 instance in step 4 by somehow initiating a transfer from s3 to the target ftp server and get a callback/notification when that transfer completes (success or error).

谢谢.

推荐答案

您可以创建一个lambda函数来执行相同的操作.

You can create a lambda function to do the same.

这里讨论了实现的完整参考.

A complete reference of the implementation is discussed here.

https://pythonvibes.wordpress. com/2016/12/09/ftp-and-sftp-through-lambda/

希望有帮助.

这篇关于s3到ftp服务器,而无需下载到ec2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆