简体   繁体   中英

how to stop EC2 instances with windows command line?

I tried to do the following:

  1. Download: client EC2 in https://aws.amazon.com/developertools/351 . And save that in C:/AWS/CLI.

  2. Create in the environment variables, a new system variable.

    • Name: JAVA_HOME
    • Value: C:\\Program Files\\Java\\jre7
  3. Create other new system variable.

    • Name: EC2_HOME
    • Value: C:\\AWS\\CLI
  4. Edit the value of the system variable Path , and add %EC2_HOME%\\bin .

  5. Create other two system variables:

    • System variable name: AWS_ACCESS_KEY , value: my access key.
    • System variable name: AWS_SECRET_KEY , value: my secret key.
  6. 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.

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