Why did Amazon EC2 terminate my instance?

Last updated: 2020-06-09

Amazon Elastic Compute Cloud (Amazon EC2) terminated my instance. How do I determine why?

Resolution

On-Demand Instances

View your AWS CloudTrail logs:

  1. Open the CloudTrail console.
  2. Choose Events history.
  3. Select Event Name in the Filter drop down, and then enter TerminateInstances to view all instance termination API calls.

Spot Instances

If the Spot price increases above your bid price, capacity is no longer available, or if Amazon EC2 can't meet the Spot request constraints, then the Spot Instance terminates.

For more information, see Spot Instance interruptions.

Instances in an Amazon EC2 Auto Scaling group

Amazon EC2 Auto Scaling might terminate instances in an Auto Scaling group for the following reasons:

  • The instance is marked as unhealthy.
  • The instance exceeded its specified keep-alive parameters.

Note: By default, AWS Elastic Beanstalk environments use Auto Scaling groups to launch EC2 instances.

For more information, see Why did Amazon EC2 Auto Scaling terminate an instance?