(EC2)通过命令行启动Windows实例编程 [英] (EC2) Launch Windows instance programmatically via command line

查看:223
本文介绍了(EC2)通过命令行启动Windows实例编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以编程方式启动的Windows 2008(64位,基本安装)实例,有点像点击启动实例链接和放大器;继创建新实例向导。

I'd like to launch a Windows 2008 (64bits, base install) instance programmatically, kinda like clicking on the Launch Instance link & following the "Create a New Instance" wizard.

我读到这个命令的 EC2-运行实例,我尝试使用这种语法上腻子运行它:

I read about this command ec2-run-instances, I tried running it on putty using this syntax:

/ OPT / AWS /斌/ EC2-运行实例 ami_id AMI-e5784391 -n 1   --availability区域欧盟 - 西-1A --region欧盟 - 西1 --instance型的m1.small --private键/full/path/MyPrivateKey.pem --group MyRDP

/opt/aws/bin/ec2-run-instances ami_id ami-e5784391 -n 1 --availability-zone eu-west-1a --region eu-west-1 --instance-type m1.small --private-key /full/path/MyPrivateKey.pem --group MyRDP

但它总是抱怨说:

Required option '-C, --cert CERT' missing (-h for usage)

根据该文件,则不需要此选项!

According to the documentation, this option isn't required!!

谁能告诉我什么是错的呢我只是想以编程方式推出全新的Windows安装,运行在云和放一些测试?;之后将其关闭。

Can someone tell me what's wrong anyway? I'm just trying to programmatically launch a fresh Windows install, run some tests on the clouds & shut it down after that.

推荐答案

该错误信息是正确的(只是尝试加入 - 证书) - 哪些文件是你这里指的?

The error message is correct (just try adding --cert ;) - to what documentation are you referring here?

要求是在的Microsoft Windows指南亚马逊EC2 ,特别是在<一个href="http://docs.amazonwebservices.com/AWSEC2/latest/WindowsGuide/InstallEC2CommandLineTools.html#set-aws-credentials"相对=nofollow>任务4:设置EC2_PRIVATE_KEY和EC2_CERT环境变量的:

The requirement is clearly outlined in the Microsoft Windows Guide for Amazon EC2, specifically in Task 4: Set the EC2_PRIVATE_KEY and EC2_CERT Environment Variables:

命令行工具需要访问一个X.509证书和   相应的与您的帐户相关联的私钥。 [...]

The command line tools need access to an X.509 certificate and a corresponding private key that are associated with your account. [...]

您可以指定您的凭据与--private密钥和   --cert参数每次你发出一个命令,也可以创建指向凭证文件在您的本地环境变量   系统。 如果环境变量配置正确,就可以   当你发出一个命令忽略参数

You can either specify your credentials with the --private-key and --cert parameters every time you issue a command or you can create environment variables that point to the credential files on your local system. If the environment variables are properly configured, you can omit the parameters when you issue a command.

[重点煤矿]

也许使用环境变量的选项已被误导莫名其妙的地方?

Maybe the option of using environment variables has been misleading somehow somewhere?

请注意,您可以缓解和加快与EC2工作相当使用覆盖相同的地面备用脚本环境,尤其是优秀的博托,其中的是一个Python包,提供到亚马逊网络服务的。

Please note that you can ease and speed up working with EC2 considerably by using alternate scripting environments covering the same ground, in particular the excellent boto, which is a Python package that provides interfaces to Amazon Web Services.

博托使用了时下比较常见的认证方案基于访问密钥只,而不是X.509证书(例如,一个AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY对),其中还可以(也应该)通过的 AWS身份和访问管理(IAM)避免让你的主AWS帐号凭据摆在首位的风险。见我的回答如何下载一个EC2 X.509证书与IAM用户帐号?了解更多这方面的细节。

Boto uses the nowadays more common authentication scheme based on access keys only rather than X.509 certificates (e.g. an AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY pair), which furthermore can (and should) be managed via AWS Identity and Access Management (IAM) to avoid the risk of exposing your main AWS account credentials in the first place. See my answer to How to download an EC2 X.509 certificate with an IAM User account? for more details on this.

祝你好运!

这篇关于(EC2)通过命令行启动Windows实例编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆