---
title: "uptimeify_maintenance_window"
description: "Ressource uptimeify_maintenance_window: Beispiel, alle Attribute, Import."
---

<Callout>Die Beschreibungen auf dieser Seite kommen direkt aus dem Provider-Schema und sind deshalb englisch.</Callout>

A maintenance window: alerts and incidents of its targets are suppressed while it runs. Set `targets` and/or `tag_ids`, or `customer_id` alone for the whole customer. A window with only organization-wide tags applies organization-wide. Import with the numeric id or the public id.

## Beispiel

```terraform
# Weekly Sunday-night window for every monitor tagged "production".
resource "uptimeify_maintenance_window" "patch_night" {
  name        = "Patch night"
  description = "OS updates"
  start_time  = "2030-01-06T02:00:00+01:00"
  end_time    = "2030-01-06T04:00:00+01:00"
  timezone    = "Europe/Berlin"
  tag_ids     = [tonumber(uptimeify_tag.production.id)]

  recurrence_pattern = {
    frequency    = "weekly"
    days_of_week = [0]
  }
}

# One-off window for two explicit monitors.
resource "uptimeify_maintenance_window" "migration" {
  name       = "DB migration"
  start_time = "2030-03-01T22:00:00Z"
  end_time   = "2030-03-02T01:00:00Z"
  targets = [
    { type = "website", id = 12 },
    { type = "dns", id = 7 },
  ]
}

# Every monitor of one customer.
resource "uptimeify_maintenance_window" "customer" {
  name        = "Customer move"
  start_time  = "2030-04-01T00:00:00Z"
  end_time    = "2030-04-01T06:00:00Z"
  customer_id = 3
}
```

## Schema

### Pflichtfelder

- `end_time` (String) End, after start_time. RFC3339 timestamp. The API answers in UTC with milliseconds (`2030-01-01T02:00:00.000Z`); another spelling of the same instant is kept as written.
- `name` (String)
- `start_time` (String) Start. RFC3339 timestamp. The API answers in UTC with milliseconds (`2030-01-01T02:00:00.000Z`); another spelling of the same instant is kept as written.

### Optional

- `customer_id` (Number) Whole-customer window: every monitor of this customer. Cannot be combined with `targets` or `tag_ids`; changing it replaces the window.
- `description` (String) At most 2000 characters.
- `is_active` (Boolean) Default `true`.
- `recurrence_pattern` (Attributes) Repeat the window. Unset = one-off window. (siehe [verschachteltes Schema](#verschachteltes-schema-für-recurrence_pattern))
- `tag_ids` (Set of Number) Numeric tag ids: every monitor carrying one of the tags is in maintenance.
- `targets` (Attributes Set) Monitors the window applies to. All targets must belong to one customer. (siehe [verschachteltes Schema](#verschachteltes-schema-für-targets))
- `timezone` (String) IANA zone the recurrence is read in, e.g. `Europe/Berlin`. Use the canonical name: the API stores aliases (`utc`, `Japan`) under their canonical spelling. Default `UTC`.

### Nur lesbar

- `created_at` (String)
- `id` (String) Numeric window id.
- `public_id` (String) Public UUID of the window.
- `updated_at` (String)

### Verschachteltes Schema für `recurrence_pattern`

Required:

- `frequency` (String) `daily`, `weekly` or `monthly`.

Optional:

- `day_of_month` (Number) Day of month, 1 to 31.
- `days_of_week` (List of Number) Weekdays, 0 = Sunday to 6 = Saturday.
- `end_recurrence_date` (String) Last date of the recurrence, e.g. `2031-12-31` or an RFC3339 timestamp.
- `interval_count` (Number) Repeat every N units of frequency (2 with weekly = every other week), 1 to 365. The API treats unset as 1.


### Verschachteltes Schema für `targets`

Required:

- `id` (Number) Numeric id of the monitor.
- `type` (String) One of `website`, `dns`, `icmp`, `smtp`, `ssh`, `tcp`, `ftp`, `imap_pop`, `customer_domain`, `customer_ip`.

## Import

Import geht so:

Mit [`tofu import` bzw. `terraform import`](https://developer.hashicorp.com/terraform/cli/commands/import), zum Beispiel:

```shell
# Numeric id or public id
terraform import uptimeify_maintenance_window.patch_night 42
```
