- Effective DevOps with AWS
- Nathaniel Felsen
- 129字
- 2021-07-15 17:11:52
Terminating our EC2 instance
As with most helloworld exercises, once the Hello World message is displayed, the goal is reached. It is now time to think about shutting down our server. Since in AWS we only pay for what we consume, freeing up unnecessary resources such as this server is a good strategy to make AWS very cost-effective.
We can do a clean shutdown of the Hello World service using the stop command, exit the virtual server, and terminate our instance, as follows:
[ec2-user@ip-172-31-22-234 ~]$ sudo stop helloworld helloworld stop/waiting [ec2-user@ip-172-31-22-234 ~]$ ec2-metadata --instance-id instance-id: i-d10e0e62 [ec2-user@ip-172-31-22-234 ~]$ exit logout $ aws ec2 terminate-instances --instance-ids i-d10e0e62 { "TerminatingInstances": [ { "InstanceId": "i-d10e0e62", "CurrentState": { "Code": 32, "Name": "shutting-down" }, "PreviousState": { "Code": 16, "Name": "running" } } ] }
推薦閱讀
- Python快樂編程:人工智能深度學習基礎
- TensorFlow Lite移動端深度學習
- SQL for Data Analytics
- C#程序設計(慕課版)
- C語言從入門到精通(第4版)
- 機械工程師Python編程:入門、實戰與進階
- Java Web開發技術教程
- Mastering ROS for Robotics Programming
- Quantum Computing and Blockchain in Business
- OpenCV with Python By Example
- Java Web 從入門到項目實踐(超值版)
- 開發者測試
- Illustrator CS6中文版應用教程(第二版)
- Hands-On Data Visualization with Bokeh
- Java Web程序開發參考手冊