I tried to do the following:
Download: client EC2 in https://aws.amazon.com/developertools/351 . And save that in C:/AWS/CLI.
Create in the environment variables, a new system variable.
JAVA_HOME
C:\\Program Files\\Java\\jre7
Create other new system variable.
EC2_HOME
C:\\AWS\\CLI
Edit the value of the system variable Path
, and add %EC2_HOME%\\bin
.
Create other two system variables:
AWS_ACCESS_KEY
, value: my access key. AWS_SECRET_KEY
, value: my secret key. Open my windows command line and execute the code:
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.
These days, it is recommended to use either:
If you like PowerShell, use that one. Otherwise, go for the 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
shutdown /s
That will shutdown (and stop, not terminate) the EC2
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.