Lambda function in python to copy files from S3 to On prem server

Question:

I am new to AWS and have to copy a file from S3 bucket to an on-prem server.
As I understand the lambda would get triggered from S3 file upload event notification. But what could be used in lambda to send the file securely.

Asked By: John

||

Answers:

Your best bet may be to create a hybrid network so AWS lambda can talk directly to an on-prem server. Then you could directly copy the file server-to-server over the network. That’s a big topic to cover, with lots of other considerations that probably go well beyond this simple question/answer.

You could send it via an HTTPS web request. You could easily write code to send it like this, but that implies you have something on the other end set up to receive it–some sort of HTTPS web server/API. Again, that could be big topic, but here’s a description of how you might do that in Python.

Another option would be to use SNS to notify something on-premise whenever a file is uploaded. Then you could write code to pull the file down from S3 on your end. But the key thing is that this pull is initiated by code on your side. Maybe it gets triggered in response to an SNS email or something like that (see here for all the available endpoints you can configure), but in this case the network flow is on-premise fetching the file from S3 versus lambda pushing it to on-premise.

There are many other options. You probably need to do more research and decide your architectural approach before getting too deep into the implementation details.

Answered By: Shawn
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.