[英]how to stop EC2 instances with windows command line?
I tried to do the following: 我试着做以下事情:
Download: client EC2 in https://aws.amazon.com/developertools/351 . 下载: https ://aws.amazon.com/developertools/351中的客户端EC2。 And save that in C:/AWS/CLI.
并将其保存在C:/ AWS / CLI中。
Create in the environment variables, a new system variable. 在环境变量中创建一个新的系统变量。
JAVA_HOME
JAVA_HOME
C:\\Program Files\\Java\\jre7
C:\\Program Files\\Java\\jre7
Create other new system variable. 创建其他新的系统变量。
EC2_HOME
EC2_HOME
C:\\AWS\\CLI
C:\\AWS\\CLI
Edit the value of the system variable Path
, and add %EC2_HOME%\\bin
. 编辑系统变量
Path
的值,并添加%EC2_HOME%\\bin
。
Create other two system variables: 创建其他两个系统变量:
AWS_ACCESS_KEY
, value: my access key. AWS_ACCESS_KEY
,值:我的访问密钥。 AWS_SECRET_KEY
, value: my secret key. AWS_SECRET_KEY
,值:我的密钥。 Open my windows command line and execute the code: 打开我的Windows命令行并执行代码:
ec2-stop-instances <id_instancia> –region <region>
I received the error: 我收到了错误:
the filename, directory name or volume label syntax is incorrect.
Why does this happen? 为什么会这样?
Those API tools look somewhat old. 这些API工具看起来有些陈旧。
These days, it is recommended to use either: 目前,建议使用以下两种方法之一:
If you like PowerShell, use that one. 如果您喜欢PowerShell,请使用它。 Otherwise, go for the AWS CLI.
否则,请转到AWS CLI。 There is good documentation for both.
两者都有很好的文档。
There's an extremely easy way to stop the instance from the instance's cmd, that is 有一种非常简单的方法可以从实例的cmd中停止实例,也就是说
shutdown /s
That will shutdown (and stop, not terminate) the EC2 这将关闭(并停止,不终止)EC2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.