Trigger an AWS lambda function with an ftp/ sftp event

0

Is there a way to trigger an AWS Lambda function right after uploading a file to an SFTP/FTP server without having to explicitly check for new updates? Now, I'm using cloud watch to trigger the function every 5 minutes to check if the file was updated or not but I would like to know if there is a more optimized method to do so.

asked 2 years ago3849 views
2 Answers
0

If the FTP server is your own server, no. It is up to you to create the mechanism.

If your FTP server writes the files to S3, you can create notifications from S3 that will launch Lambda functions.

In AWS we do have a service called AWS Transfer for FTP that uses the FTP protocol to upload files to S3, so that you can then invoke functions directly.

profile pictureAWS
EXPERT
Uri
answered 2 years ago
0

With custom, you may have to use your own implementation logic. Alternatively you can use AWS Transfer Family which is a secure transfer service that enables you to transfer files into and out of AWS storage services.

AWS Transfer Family supports transferring data from or to the following AWS storage services.

  1. Amazon Simple Storage Service (Amazon S3) storage.
  2. Amazon Elastic File System (Amazon EFS) Network File System (NFS) file systems.

AWS Transfer Family supports transferring data over the following protocols:

  • Secure Shell (SSH) File Transfer Protocol (SFTP): version 3
  • File Transfer Protocol Secure (FTPS)
  • File Transfer Protocol (FTP)
  • Applicability Statement 2 (AS2)

You can also use custom file-processing step, you can Bring Your Own file-processing logic using AWS Lambda. Upon file arrival, a Transfer Family server invokes a Lambda function that contains custom file-processing logic, such as encrypting files, scanning for malware, or checking for incorrect file types

References

  1. https://docs.aws.amazon.com/transfer/latest/userguide/what-is-aws-transfer-family.html
  2. https://docs.aws.amazon.com/transfer/latest/userguide/custom-step-details.html
profile pictureAWS
EXPERT
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions