renanivo / lambda-s3-sftp Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED! AWS lambda function to send an S3 file, whenever it is uploaded, to a remote server using SFTP
License: MIT License
DEPRECATED! AWS lambda function to send an S3 file, whenever it is uploaded, to a remote server using SFTP
License: MIT License
key_filename
does not appear to be used in the script. Should that be removed?
Also, have you given consideration to the security risk in pasting a SSH private key inside the script?
I need to know how to set up the trigger for this scenario. When running, it said no module name Paramiko
Error is:
cp -r /lib/python2.7/site-packages/. dist/
cp: cannot stat '/lib/python2.7/site-packages/.': No such file or directory
Here's the Python paths that exist on Ubuntu 17.10:
$ python -c "import sys; print('\n'.join(sys.path))"
/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/home/mark/.local/lib/python2.7/site-packages
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/gtk-2.0
I'm not sure which directory or directory should be used instead.
Since I didn't run make install
as root, it seems most files got installed into:
/home/mark/.local/lib/python2.7/site-packages
If you are using key/password authentication and don't define 'PRIVATE_KEY', the Lambda function fails, because PRIVATE_KEY is used anyway:
not a valid RSA private key file: SSHException Traceback (most recent call last): File "/var/task/main.py", line 18, in lambda_handler pkey = paramiko.RSAKey.from_private_key(StringIO(PRIVATE_KEY))
From reading the code and the related docs it appears this could be fixed by defaulting pkey = None
and only setting it to the contents of PRIVATE_KEY if PRIVATE_KEY has a non-zero length.
As the project has no automated tests, I think would be good to start with a simple end-to-end test of a s3:ObjectCreated:Put event that uploads a file to a SFTP.
The docker-lambda can be used to invoke the function locally. The SFTP server could be set up with a docker container as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.