## 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.

```text
An error occurred (UnknownMonitorException) when calling the UpdateAnomalySubscription operation: The cost anomaly monitor does not exist for the account
```

## Use 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
1. List subscriptions to find the orphan: `aws ce get-anomaly-subscriptions --max-results 100`. Verify: the subscription shows a monitor ARN that `get-anomaly-monitors` no longer lists.
2. 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.
3. 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.
4. Confirm alerts resume by checking the subscription's recent evaluation state. Verify: no further UnknownMonitorException on describe calls.
5. 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
