简体   繁体   English

快速部署云服务器

[英]Deploying Cloud Servers on the Fly

I'm wondering if it's possible to deploy a clone of a server on a per user basis on something like AWS? 我想知道是否可以在每个用户的基础上在AWS之类的服务器上部署服务器的克隆? I want to simulate interaction for training purposes with a small network (pings, TCP scans etc) through a Web application. 我想通过Web应用程序与一个小型网络(ping,TCP扫描等)进行模拟交互以进行培训。 My initial thoughts are to just fake the responses one would expect to see with another part of the Web app. 我最初的想法是伪造一个人希望在Web应用程序的另一部分中看到的响应。 However I'm wondering if this could be done by actually setting up a network on AWS once the user loads my application. 但是我想知道是否可以通过在用户加载我的应用程序后在AWS上实际设置网络来完成。

Ideally it would be great if the instance could be torn down again once the user has finished for security reasons. 理想情况下,一旦用户出于安全原因完成该实例后可以再次拆除该实例,那就太好了。

Is this sort of thing possible yet or am I living in a dream world? 这样的事情有可能发生吗,或者我生活在一个梦想的世界中? I don't need any specifics as of yet, just a pointer in the right direction. 到目前为止,我还不需要任何细节,只需一个正确方向的指针即可。

Yes this is definitely possible. 是的,这绝对是可能的。

You can use the AWS APIs in whichever your chosen language is ( https://aws.amazon.com/tools/ ) to communicate with AWS and set up EC2s (machine instances). 您可以使用所选择的语言( https://aws.amazon.com/tools/ )中的任何一种来使用AWS API与AWS进行通信并设置EC2(机器实例)。 If you manually set them up in the console first, remote onto them, and then setup all the software etc you require. 如果您首先在控制台中手动设置它们,然后远程安装它们,然后设置所需的所有软件等。 Them if you save these as AMI (amazon machine images) you can programmatically relaunch as many of these whenever required based on this AMI. 如果将它们另存为AMI(亚马逊机器映像),则可以根据需要以编程方式重新启动其中的许多AMI。

Make sure you are using --instance-initiated-shutdown-behavior terminate to ensure when you shut down these ec2 instances they terminate and stop charging you money. 确保您正在使用--instance-initiated-shutdown-behavior终止,以确保当您关闭这些ec2实例时,它们会终止并停止向您收费。

I would have a go with the AWS Console first, see if you can set up what you want, then look at saving these as AMI's and programmatically launching them 我将首先使用AWS控制台,看看是否可以设置所需的内容,然后查看将其保存为AMI并以编程方式启动它们

If you want to set up a small network for training, I would recommend creating a VPC, and launching your instances into that. 如果您想建立一个小型网络进行培训,我建议您创建一个VPC,并在其中启动实例。 That way you will have complete control over networking, routing, protocols, etc. 这样,您将完全控制网络,路由,协议等。

You should be able to create a cloudformation script that will create the entire environment for you with a single command, and when you're done it's another command to tear it all down again. 您应该能够创建一个cloudformation脚本,该脚本将使用一个命令为您创建整个环境,完成后,这是另一个命令,可以再次将其全部拆除。

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

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