UnknownMonitorException: The cost anomaly monitor does not exist for the account" - the monitor was deleted but the...
Repairs an AWS cost anomaly subscription left pointing at a deleted monitor. Covers finding the orphaned subscription, re-creating or re-pointing the monitor, and updating the subscription. Use when anomaly alerts reference a monitor ARN that no longer exists. Not for monitors that exist but never fire.
TL;DR
The monitor was deleted but its alert subscription survived, and now the subscription points at nothing. Re-create the monitor (or pick an existing one), then update the subscription with the new monitor ARN. Deleting monitors and subscriptions together from now on prevents this.
An error occurred (UnknownMonitorException) when calling the UpdateAnomalySubscription operation: The cost anomaly monitor does not exist for the accountUse this when
- An anomaly subscription update or describe fails with
UnknownMonitorException. - Alert history stops right after a monitor cleanup.
- IaC shows the subscription resource but the monitor resource is gone.
Not for this skill when
- The monitor exists. Check the ARN spelling and region instead.
- Alerts never fire on a live monitor. That is a threshold or dimension problem.
Steps
- List subscriptions to find the orphan:
aws ce get-anomaly-subscriptions --max-results 100. Verify: the subscription shows a monitor ARN thatget-anomaly-monitorsno longer lists. - Decide the fix. Option A: re-create the monitor with the same dimension and name, then note its new ARN. Option B: point the subscription at an existing monitor that covers the same scope. Verify: the target monitor ARN exists.
- Update the subscription:
aws ce update-anomaly-subscription --subscription-arn [subscription arn] --monitor-arn [new monitor arn]. Verify: the call returns success and the subscription lists the new monitor. - Confirm alerts resume by checking the subscription's recent evaluation state. Verify: no further UnknownMonitorException on describe calls.
- If the subscription was also deleted, re-create it against the new monitor ARN. Verify: subscribers receive the next test or real alert.
Terraform drift variant
When the monitor was deleted out of band, terraform plan shows the subscription unchanged. Verify: terraform apply with the corrected monitor ARN reference converges.
Compatibility: AWS Cost Explorer Anomaly Detection, all regions where the service is available.
Why it happens
Monitors and subscriptions are separate resources with independent lifecycles. The API lets you delete a monitor without touching its subscriptions, so any cleanup that only removes monitors leaves dangling references that fail on the next touch.
Edge cases / pitfalls
- Re-created monitors get new ARNs even with identical names, so subscriptions must be updated explicitly.
- Evaluate the new monitor's alert history threshold; a re-created monitor starts fresh and may alert differently for a week.
- In consolidated billing, confirm which account owns the monitor before re-creating it.
- Put monitor and subscription in the same IaC module so they share a lifecycle.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_Se4rhIf68YkQfFF8JHIJbg