0

I need to ssh to a non-AWS instance to push some files via Lambda. I see ssh from Lambda is possible but I can't see an example of ssh to a non-AWS instance. Is it possible?

1
  • I don't see a reason why you coudn't do it. This probably will require custom deployment package probably to bundle necessary libraries for that, such as Fabric for python. Commented May 5, 2020 at 9:30

2 Answers 2

1

It is rather unusual to use SSH from an AWS Lambda function. SSH is normally used for humans to login to a Linux computer.

If your goal is to get files onto a computer that is somewhere on the Internet, a better architecture might be to put the files in Amazon S3 and then have the remote computer 'pull' the data from S3. This offers better security and is a more 'loosely coupled' architecture.

If you do need to copy files from via an AWS Lambda function, consider using scp instead. There is a Python library available: scp · PyPI

Sign up to request clarification or add additional context in comments.

2 Comments

the partner system cannot pull, I have to push via ssh only. The files are small so I don't wanna use the ETL tool and I don't wanna spin an EC2 instance just for this activity.
Some people use the Paraminko SSH library. Here's an example: Scheduling SSH jobs using AWS Lambda | AWS Compute Blog
0

You would want to connect to the non-aws instance via SFTP. You would want a library based on your runtime that supports SFTP.

Is their an intrinsic need to have the files be stored on a remote instance?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.