Giter VIP home page Giter VIP logo

lambda-s3-sftp's People

Contributors

markstos avatar renanivo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

lambda-s3-sftp's Issues

SSH_KEY_FILENAME and key_filename not used

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?

paramiko is not importing.

I need to know how to set up the trigger for this scenario. When running, it said no module name Paramiko

`make package` fails on Ubuntu 17.10

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

fails when not using public key authentication

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.

Setup end-to-end tests

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.