- Effective DevOps with AWS
- Yogesh Raheja Giuseppe Borgese Nathaniel Felsen
- 134字
- 2021-07-23 16:27:30
Terminating our EC2 instance
As with most Hello World exercises, once the helloworld message is displayed, the goal is reached. It is now time to think about shutting down our server. Since we only pay for what we consume in AWS, freeing up unnecessary resources such as this server is a good strategy for making AWS very cost effective.
We can do a clean shutdown of the Hello World service using the stop command. We can then exit the virtual server and terminate our instance, as follows:
[ec2-user@ip-172-31-22-52 ~]$ sudo stop helloworld helloworld stop/waiting [ec2-user@ip-172-31-22-52 ~]$ ec2-metadata --instance-id instance-id: i-057e8deb1a4c3f35d [ec2-user@ip-172-31-22-52 ~]$ exit logout $ aws ec2 terminate-instances --instance-ids i-057e8deb1a4c3f35d { "TerminatingInstances": [ { "InstanceId": "i-057e8deb1a4c3f35d", "CurrentState": { "Code": 32, "Name": "shutting-down" }, "PreviousState": { "Code": 16, "Name": "running" } } ] }
推薦閱讀
- 數(shù)據(jù)展現(xiàn)的藝術(shù)
- 網(wǎng)頁編程技術(shù)
- Practical Data Wrangling
- 來吧!帶你玩轉(zhuǎn)Excel VBA
- 離散事件系統(tǒng)建模與仿真
- 21天學(xué)通Java
- Android游戲開發(fā)案例與關(guān)鍵技術(shù)
- Kubernetes for Serverless Applications
- Blender 3D Printing by Example
- SAP Business Intelligence Quick Start Guide
- Spatial Analytics with ArcGIS
- Mastering Geospatial Analysis with Python
- Learning ServiceNow
- 貫通開源Web圖形與報表技術(shù)全集
- 30天學(xué)通Java Web項目案例開發(fā)