celerdatabyoc_cluster_maintenance_window
Manages a recurring maintenance window on a CelerData cluster. When a security patch (an AMI or StarRocks patch release) is published for the cluster, the scheduler picks the next occurrence of one of the cluster's enabled windows and applies the patch inside it, instead of requiring you to coordinate an upgrade time by hand.
A window is scoped to one cluster. A cluster can have several windows, each
managed as its own resource; the scheduler uses whichever comes first. All
windows of a cluster must share one window_type: once the first window is
WEEKLY, every further window on that cluster must be WEEKLY too (likewise
for MONTHLY). A mismatch is reported at plan time when the cluster already
exists, otherwise on apply. Deleting the resource deletes the window; pending
patches then wait until the cluster has another enabled window.
Example Usage
resource "celerdatabyoc_cluster_maintenance_window" "weekly" {
cluster_id = celerdatabyoc_elastic_cluster_v2.prod.id
window_type = "WEEKLY"
day_of_week = "SUNDAY"
start_time = "02:00"
end_time = "05:00"
timezone = "America/Los_Angeles"
}
# A second window on the same cluster must use the same window_type.
resource "celerdatabyoc_cluster_maintenance_window" "midweek" {
cluster_id = celerdatabyoc_elastic_cluster_v2.prod.id
window_type = "WEEKLY"
day_of_week = "WEDNESDAY"
start_time = "01:00"
end_time = "04:00"
timezone = "America/Los_Angeles"
enabled = true
}
Argument Reference
Required
cluster_id: (String, ForceNew) ID of the cluster the window applies to. Changing it recreates the window.window_type: (String) Recurrence of the window. One ofWEEKLY,MONTHLY. Must match the type of every other window on the cluster. A cluster's only window can be changed to the other type in place; to switch a cluster with several windows, remove the others first.start_time: (String) Window start asHH:mm(zero-padded, 24-hour) intimezone.end_time: (String) Window end asHH:mmintimezone. Must be at least 120 minutes afterstart_timeon the same day.
Optional
day_of_week: (String) Weekday the window recurs on, one ofMONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY,SUNDAY. Required whenwindow_typeisWEEKLY; must not be set otherwise.day_of_month: (Integer) Day of the month,1through31. Required whenwindow_typeisMONTHLY; must not be set otherwise. In months shorter than that day (e.g.31in February), the window falls on the last day of the month instead of being skipped.timezone: (String) IANA time zone name the times are interpreted in. Defaults toUTC.enabled: (Boolean) Whether the scheduler may use this window. Defaults totrue. A disabled window is kept but never selected.
Attribute Reference
In addition to the arguments above, this resource exports:
id: (String)<cluster_id>:<window_id>.window_id: (String) The window ID assigned by CelerData.
Import
Maintenance windows can be imported with <cluster_id>:<window_id>. Window IDs
can be listed with GET /api/1.0/clusters/<cluster_id>/maintenance-windows.
terraform import celerdatabyoc_cluster_maintenance_window.weekly <cluster_id>:<window_id>