# Delete an alarm

Delete an alarm and its history; the resource it watched is not affected.

Replace _alarm-id_ with the alarm's id.

**Warning:**
The alarm's history is deleted with it and cannot be restored.

## Prerequisites

- Permission for `monitoring:DeleteAlarms` on the alarm,
  `rn:ews::<organization id>:monitoring:alarm/<alarm id>`. Without it, the console's
  **Delete alarm** is unavailable, with the note "Needs monitoring:DeleteAlarms on this alarm."
- In the console, also `monitoring:DescribeAlarms` to open **Alarms**.

## Delete the alarm

**Console**
1. Open **Monitoring**, then **Alarms**.
2. Open the alarm's action menu and choose **Delete alarm**.
3. Choose **Delete**.

**CLI**
```sh
dcloud monitoring alarms delete alarm-id
```

**API**
```http
DELETE /monitoring/api/alarms/alarm-id
```

**Terraform**
Remove the `dcloud_monitoring_alarm` from your configuration and apply, or run
`terraform destroy -target`.

## Result

The alarm disappears from the list. The answer is `200` with its `id`; `404` "Alarm not found" when
your organization has no such alarm.

A default alarm another service made for its resource (it carries an `ownerType` and `ownerId`) can
be deleted like any other, and is not made again.

## Related

- [Change an alarm](change-an-alarm.md)
- `monitoring.alarms.delete` · `dcloud monitoring alarms delete`
