An instance has a life: it boots, runs, may stop and start, and eventually ends. Each transition has rules.
States
aws ec2 stop-instances --instance-ids i-…
aws ec2 start-instances --instance-ids i-…
aws ec2 reboot-instances --instance-ids i-…
aws ec2 terminate-instances --instance-ids i-…Stop is a clean shutdown; the disk persists, the private IP persists, and the instance can start again. Reboot is a restart without leaving running. Terminate ends it: the instance vanishes from listings after a while and cannot be recovered. A stopped instance costs nothing for compute but still pays for its disk, which is why forgotten stopped instances still appear on the bill.
The public IP problem
Stop and start an instance and its public IP changes, because the address was borrowed from a pool. Anything that remembered the old address breaks. An Elastic IP is an address you own:
aws ec2 allocate-address --domain vpc
aws ec2 associate-address --allocation-id eipalloc-… --instance-id i-…Associated, it stays with the instance through stops and starts. Released, it goes back to AWS. An Elastic IP costs a small hourly fee, more when allocated and not attached, which the bill shows as ElasticIP:IdleAddress.
Protection
aws ec2 modify-instance-attribute --instance-id i-… --disable-api-termination
aws ec2 terminate-instances --instance-ids i-…An error occurred (OperationNotPermitted) when calling the TerminateInstances operation: The instance 'i-…' may not be terminated. Modify its 'disableApiTermination' instance attribute and try again.Termination protection makes the wrong terminate-instances fail. Production instances carry it; turning it off is a deliberate step before a deliberate termination.
Health
aws ec2 describe-instance-status --instance-ids i-… --query "InstanceStatuses[0].[SystemStatus.Status,InstanceStatus.Status]" --output textTwo status checks run continuously. The system check is about the host hardware and network, AWS's side; if it fails, stop and start moves the instance to a healthy host. The instance check is about the operating system inside; if it fails, the fix is a reboot or a look at the console output (get-console-output).