0

I am using EC2 Spot Instance interruption notices to architect a fault tolerant application running on Amazon Linux. On receiving the warning, some logs are stored and I no longer need the instance for the upcoming 2 minutes. If Amazon EC2 interrupts a spot instance in the first hour, it should not be charged according to the documentation. After storing the logs, should I check instance run time before triggering a termination request? e.g. If it has been running for less than 58 minutes, just keep it running to avoid getting charged for the first hour. Will an api termination request cause it to be considered a billable manual termination despite the interruption warning?

Ahmed Sheashaa
  • 132
  • 2
  • 11
  • What documentation? Any link? Where exactly does it say that spot instances are free for 1 h? – Marcin May 04 '22 at 02:53
  • @Marcin nothing in the question states that spot instances are free for 1 hour. If amazon EC2 interrupts a Linux spot instance in the first hour, it's not charged. See [Billing for interrupted Spot Instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/billing-for-interrupted-spot-instances.html) – Ahmed Sheashaa May 04 '22 at 03:01
  • Yes, so if aws does not charge for the first hour, then its free for the first hour, isn't it? – Marcin May 04 '22 at 03:03
  • It's free `Only if` the instance is interrupted in the first hour. However if the instance is interrupted after one hour, it is charged for the seconds used including the first hour. So, spot instances are not free for 1 hour, but the first hour is free only in case the instance was interrupted in the first hour, and this applies to specific operating systems according to the docs above. – Ahmed Sheashaa May 04 '22 at 03:09
  • You're charged based off who terminates the instance. It doesn't matter if AWS would have terminated the instance, if you terminate it, you're charged for the full hour (or partial time for Windows) – Anon Coward May 04 '22 at 03:59

0 Answers0