简体   繁体   English

以编程方式连接到EC2实例吗?

[英]Connect to EC2 instance programmatically?

I am new to android development and AWS. 我是android开发和AWS的新手。 I am trying to make a PDF convertor android app where user can upload a TEXT file to EC2 (in EBS volume), it is then processed by my EC2 instance and then stored in S3. 我正在尝试制作一个PDF转换器android应用程序,用户可以在其中将TEXT文件上传到EC2(以EBS卷的形式),然后由我的EC2实例进行处理,然后存储在S3中。

My primary task is to connect(and upload file) to EC2 instance from my Android program. 我的主要任务是从我的Android程序连接(并上传文件)到EC2实例。 How can I do it? 我该怎么做?

I know that using PUTTY and SSH we can upload files to EC2. 我知道使用PUTTY和SSH我们可以将文件上传到EC2。 How it can be done programmatically in my case? 在我的情况下,如何以编程方式完成?

If you are writing this for an android app, connecting via SSH probably isn't the best way to go. 如果您是为Android应用程序编写此代码,则通过SSH连接可能不是最佳方法。 You would have to put your key/password in the app, and it could likely be extracted. 您必须将密钥/密码放入应用程序中,并且很可能将其提取出来。

The general way to solve something like this is to set up a REST API. 解决此类问题的一般方法是设置REST API。 You can write this in any language you feel comfortable with. 您可以使用自己喜欢的任何语言来编写。 The REST API would process the upload and do all the server side work. REST API将处理上载并完成所有服务器端工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM