Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
/ lambda-s3-sftp Public archive

DEPRECATED! AWS lambda function to send an S3 file, whenever it is uploaded, to a remote server using SFTP

License

Notifications You must be signed in to change notification settings

renanivo/lambda-s3-sftp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

λ S3 to SFTP

Send an S3 file, whenever it is uploaded, to a remote server using SFTP

Warning: This repository is not under development or maintenance anymore, I strongly recommend using the yunojuno's fork instead

Deployment

  1. If you are using a private key to connect to SFTP, edit main.py and put its value inside the PRIVATE_KEY var
  2. make package
  3. Upload package.zip to AWS Lambda (on console or command line)

Configuration in AWS Lambda

  • Select Python 2.7 as the runtime environment.
  • In AWS Lambda, you can define a trigger. Select S3 and then PUT. you can limit the triggers to a particular folder there.
  • Set the handler name to "main.lambda_handler"
  • Make sure you give Lambda permission to read from S3

Supported Events

  • S3 PUT

Function Environment Vars

Name Description Required
SSH_HOST SSH server name or ip address Yes
SSH_PORT SSH server port Not (default: 22)
SSH_DIR Directory where the uploaded files should be placed in the SSH server No (default: SFTP home folder)
SSH_USERNAME SSH username for the connection Yes
SSH_PASSWORD SSH server password Not (default: None)

Caveats

This function does not replicates the S3 directory structure, it just copies every file uploaded to S3 to the SSH_DIR in the SSH_HOST.

About

DEPRECATED! AWS lambda function to send an S3 file, whenever it is uploaded, to a remote server using SFTP

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published