简体   繁体   English

创建程序来管理Amazon EC2实例

[英]Creating a program to manage Amazon EC2 instances

I am attempting to create a program that can manage EC2 instances (create, stop, terminate). 我正在尝试创建一个可以管理EC2实例(创建,停止,终止)的程序。 I am unfamiliar with the service, and after looking through documentation and searching the web have not found any general advice on creating a management service. 我不熟悉该服务,在浏览文档并在网上搜索后,未发现有关创建管理服务的任何一般性建议。 My questions are: 我的问题是:

What programming environment/language would best be suited to creating a management program? 哪种编程环境/语言最适合创建管理程序?

How can this program interact with EC2 instances? 该程序如何与EC2实例交互? (I've looked into AWS EC2 command line tools . Can these be used from a program to create/terminate instances?) (我研究了AWS EC2命令行工具 。可以在程序中使用它们来创建/终止实例吗?)

Any general advice in accomplishing this is appreciated (links to examples especially). 任何实现此目的的一般建议都值得赞赏(尤其是链接到示例)。

I guess you are new to the cloud and aws world, you can use AWS Command line tools to management the services. 我想您是云和AWS领域的新手,您可以使用AWS Command Line工具来管理服务。 Also to make things pretty simpler you can make use of the readily available aws management console if you are only worry is to start, stop or terminate the instance. 如果您只是担心启动,停止或终止实例,还可以使事情变得更简单,可以使用易于使用的aws管理控制台。 Also people have build some thing called Config management system like opscode chef which is built of ruby or you can use puppet built of puppet lab's custom DSL. 人们还建立了称为Config管理系统的东西,例如opscode Chef,它是由ruby构建的,或者您可以使用由puppet lab的自定义DSL构建的puppet。

What programming environment/language would best be suited to creating a management program? 哪种编程环境/语言最适合创建管理程序?

This question cannot be answered in a definite way, rather you should either choose the language you are most comfortable with or that's best suited to your environment/team instead - there are plenty to choose from, most popular major languages are covered by a dedicated SDK (currently Java, .NET, Node.js, Python, PHP, Ruby), see Tools for Amazon Web Services for the detailed listing and links to further information about each. 这个问题无法以明确的方式回答,您应该选择最适合自己的语言,或者最适合您的环境/团队的语言-有很多选择,专用的SDK涵盖了大多数流行的主要语言(当前为Java,.NET,Node.js,Python,PHP,Ruby),请参阅Amazon Web Services工具以获取详细列表和指向每个工具的更多信息的链接。

How can this program interact with EC2 instances? 该程序如何与EC2实例交互?

All the SDKs (and also the command line tools build on top of these) do use the AWS APIs to interact with the respective services (each one has a separate API, but most of them are structured very similar), see Documentation for a listing of all currently available services and links to their documentation: 所有SDK(以及基于这些SDK的命令行工具)均使用AWS API与相应的服务进行交互(每个都有单独的API,但大多数结构非常相似),请参阅清单中的文档 。当前可用的所有服务及其文档的链接:

Welcome to the Amazon Web Services (AWS) Documentation. 欢迎使用Amazon Web Services(AWS)文档。 Whether you are new to AWS or an advanced user, you can find useful information about the services ranging from introductions to advanced features. 无论您是AWS的新手还是高级用户,都可以找到有关服务的有用信息,从简介到高级功能。

To learn how you can get started with AWS, see our Getting Started with AWS guide. 要了解如何开始使用AWS,请参阅我们的AWS入门指南。 If you are interested in learning more about our AWS Free Usage Tier , see our AWS free usage tier article. 如果您想了解有关我们的AWS免费使用套餐的更多信息,请参阅我们的AWS免费使用套餐文章。

I am not sure if you really need a program to do that. 我不确定您是否真的需要一个程序来执行此操作。 The Amazon Management Console ( https://console.aws.amazon.com ) is pretty straight forward, simple to use, you can spin thousands of instances in a very short time. Amazon Management Console( https://console.aws.amazon.com )非常简单,易于使用,您可以在很短的时间内旋转成千上万个实例。 I created 20 instances in about 3 minutes and deleted(terminated) 9 during my first interaction with the technology. 我在大约3分钟内创建了20个实例,并在与该技术的第一次互动中删除了9个(终止)。 Would you provide a use case where this is necessary? 您会在必要时提供用例吗? Its like you want to create a missile to kill a chicken(rather than buy a knife) 就像您想制造一种导弹来杀死一只鸡一样(而不是买刀)

HTH, Thanks, Bles HTH,谢谢,Bles

I used to work on a project that deals a lot with EC2 and one of my responsibility was to manage instances remotly( deploy/start/stor/reboot). 我曾经在一个涉及EC2的项目上工作,我的职责之一是远程管理实例(部署/启动/存储/重启)。 I used Java and the Amazon API to write a communication module for the application. 我使用Java和Amazon API编写了应用程序的通信模块。

In addition I made a few general ant scripts to deal with code that has to be deploed into an instance. 另外,我制作了一些通用的ant脚本来处理必须部署到实例中的代码。 Kind a old fashion way, but works perfectly :) 有点旧的时尚方式,但是效果很好:)

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

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