EC2 Instance Checks

Learn about EC2 instance status checks.

We'll cover the following

Status checks

AWS does some default status checks on our EC2 instance. These system status checks help us identify if the EC2 instance has encountered problems that might affect its normal functioning. These are the built-in status checks in the EC2 instances that we can’t configure. The status checks are performed every minute on the instance. If all the checks pass, the overall status of the instance is okay, and if one or more checks fail, the overall status is impaired.

AWS performs two types of status checks on our instances:

  • System status checks: These checks monitor the AWS hardware and software used to run the EC2 instances. When this status check fails, we have three options:

    • We can either stop and restart (not reboot) our EC2 instance, which will assign a new host to our EC2 instance and fix the issue for us. This solution will only work if our EC2 instance is EBS-backed.
    • We can terminate instance store-backed instances and provision new EC2 instances.
    • We can wait for AWS to fix the issue on its end.
  • Instance status checks: These checks monitor issues with our EC2 instances, like memory exhaustion, corrupted file systems, and more. When the instance status check fails, we can resolve this issue by rebooting the system or changing the instance configuration.

We can set up self-healing architectures by using Cloudwatch alarms that allow our EC2 instances to automatically perform a preset action if the status check fails.

Practical

In the following widget, we’ll:

  • Create a key pair.
  • Create a security group.
  • Find AMI and subnet IDs.
  • Launch a new EC2 instance.
  • Create a CloudWatch alarm to initiate the ec2:recover action whenever the instance fails its status checks.

Get hands-on with 1200+ tech skills courses.