When you launch an EC2 instance, it first enters the "pending"
state and then transitions to the "running"
state. When you stop that instance, it first enters the "stopping"
state and then transitions to the "stopped"
state.
Each time an instance transitions from "stopped"
to "running"
, AWS charges for a full instance hour, even if these transitions happen multiple times within a single hour.
Therefore, if you restart an EC2 instance multiple times in an hour, each restart incurs an hour of usage. When these restarts occur consistently throughout a month, the instance usage hours tend to exceed the total available hours in that month.
For more information, see EC2 Instance Lifecycle