What if you could instantly know which cloud computers are ready to work and which are just wasting your money?
Why Instance states (running, stopped, terminated) in AWS? - Purpose & Use Cases
Start learning this pattern below
Jump into concepts and practice - no test required
Imagine you have many computers (called instances) in the cloud, and you try to keep track of which ones are turned on, off, or completely deleted by writing notes on paper or spreadsheets.
This manual tracking is slow and confusing. You might forget to update the status, accidentally try to use a computer that is off, or waste money paying for computers you thought were stopped but are still running.
Cloud providers show clear instance states like running, stopped, and terminated. This helps you instantly know the exact status of each computer, so you can manage them easily and avoid mistakes.
Check spreadsheet for instance status
Manually log into instance to verifyUse AWS console or CLI to see instance state aws ec2 describe-instances --query 'Reservations[*].Instances[*].State.Name' --output text
It lets you quickly control and optimize your cloud resources by knowing exactly which instances are active, paused, or gone.
A developer stops an instance to save costs during the weekend, then starts it again on Monday without losing any data or configuration.
Manual tracking of instance states is error-prone and inefficient.
Cloud instance states provide clear, real-time status information.
This helps save money, avoid mistakes, and manage resources smoothly.
Practice
Solution
Step 1: Understand EC2 instance states
Instances can be in states like running, stopped, or terminated, indicating their power and availability status.Step 2: Identify the state meaning 'powered on'
The 'running' state means the instance is powered on and ready to use.Final Answer:
Running -> Option AQuick Check:
Running = Powered On [OK]
- Confusing stopped with running
- Thinking terminated means running
- Mixing pending with running
i-1234567890abcdef0?Solution
Step 1: Identify command to stop instance
The command to stop an instance isstop-instances.Step 2: Match instance ID usage
The command must include--instance-ids i-1234567890abcdef0to specify the instance.Final Answer:
aws ec2 stop-instances --instance-ids i-1234567890abcdef0 -> Option DQuick Check:
Stop instance = stop-instances command [OK]
- Using terminate instead of stop
- Using start instead of stop
- Using reboot instead of stop
aws ec2 terminate-instances --instance-ids i-0abcdef1234567890
Solution
Step 1: Understand the terminate-instances command
This command deletes the instance permanently, changing its state to terminated.Step 2: Identify the resulting state
After termination, the instance cannot be started again and is marked as terminated.Final Answer:
Terminated -> Option CQuick Check:
Terminate command = Terminated state [OK]
- Thinking terminated means stopped
- Confusing terminate with stop
- Expecting instance to restart automatically
Solution
Step 1: Analyze error meaning
If AWS says the instance does not exist, it usually means it was deleted or terminated.Step 2: Match instance state to error
Terminated instances are removed and cannot be started again, causing this error.Final Answer:
The instance is terminated -> Option AQuick Check:
Instance not found = Terminated state [OK]
- Assuming stopped means instance missing
- Confusing running with missing
- Ignoring termination possibility
Solution
Step 1: Understand cost and data retention
Stopping an instance powers it off but keeps the attached storage intact, preserving data.Step 2: Compare with termination
Terminating deletes the instance and storage, losing data and cannot be restarted.Step 3: Choose correct state for saving costs and keeping data
Stopping is the correct choice to save costs while keeping data safe.Final Answer:
Stop, because it powers off the instance but keeps data on the disk -> Option BQuick Check:
Stop = Save cost + keep data [OK]
- Choosing terminate and losing data
- Thinking running saves cost
- Confusing pending with stop
