The bill is higher than it should be. Someone started a test server called old-demo-1l5h8t2 weeks ago and forgot it. Nobody knows which region it is in. The account uses two: us-east-1 and eu-west-1.
- Look for instances in
us-east-1, with the command from the lesson. - Look in
eu-west-1. - When you find it, copy its id (it starts with
i-), and stop it:
New command
aws ec2 stop-instances
Stops an instance. It stays in the account and you can start it again, but you stop paying for its running hours.
Usageaws ec2 stop-instances --region region --instance-ids instance-id
Example
aws ec2 stop-instances --region ap-southeast-2 --instance-ids i-0f3c9a71e2b84d605
- Look again: its state turns to
stopping, thenstopped.
Objectives
- Which region is the forgotten server in?
- Stop
old-demo-1l5h8t2.