Interview Prep/Python for DevOps/AWS automation with boto3

CloudWatch shows no `CPUUtilization` data for some instances, and your idle-instance check flags them as idle. What is wrong with the check?

IntermediateScenarioAWS automation with boto3
Answer

Situation read → "No data" is being treated as "zero CPU".

What I'd do →

  1. Treat empty Datapoints as unknown and skip (or report separately), never as idle.
  2. Check why there is no data: newly launched, stopped most of the period, wrong region or dimension, or the metric name typo.
  3. Require a minimum number of datapoints over the window before judging.
  4. Consider network and disk metrics too; a low-CPU instance can be a busy proxy.

Why → Missing data is not evidence of idleness; acting on it stops real workloads.

Interview tip → Our lab's idle_instances check skips instances without datapoints for exactly this reason.

All Python for DevOps questions Roadmap: Python for automation

More on AWS automation with boto3