July 2017
Intermediate to advanced
402 pages
9h 38m
English
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": ...Read now
Unlock full access