Skip to content

[ResponseOps] Maintenance Window Resource #1037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Adds updated docs.
  • Loading branch information
adcoelho committed Apr 22, 2025
commit 2113704eb421b7508f59c4c26ec95bd9df5284e0
72 changes: 72 additions & 0 deletions docs/resources/kibana_maintenance_window.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "elasticstack_kibana_maintenance_window Resource - terraform-provider-elasticstack"
subcategory: ""
description: |-
Creates a Kibana Maintenance Window.
---

# elasticstack_kibana_maintenance_window (Resource)

Creates a Kibana Maintenance Window.



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `custom_schedule` (Block List, Min: 1, Max: 1) A set schedule over which the maintenance window applies. (see [below for nested schema](#nestedblock--custom_schedule))
- `title` (String) The name of the maintenance window.

### Optional

- `enabled` (Boolean) Whether the current maintenance window is enabled.
- `scope` (Block List, Max: 1) An object that narrows the scope of what is affected by this maintenance window. (see [below for nested schema](#nestedblock--scope))
- `space_id` (String) An identifier for the space. If space_id is not provided, the default space is used.

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--custom_schedule"></a>
### Nested Schema for `custom_schedule`

Required:

- `duration` (String) The duration of the schedule. It allows values in `<integer><unit>` format. `<unit>` is one of `d`, `h`, `m`, or `s` for hours, minutes, seconds. For example: `1d`, `5h`, `30m`, `5000s`.
- `start` (String) The start date and time of the schedule, provided in ISO 8601 format and set to the UTC timezone. For example: `2025-03-12T12:00:00.000Z`.

Optional:

- `recurring` (Block List, Max: 1) (see [below for nested schema](#nestedblock--custom_schedule--recurring))
- `timezone` (String) The timezone of the schedule. The default timezone is UTC.

<a id="nestedblock--custom_schedule--recurring"></a>
### Nested Schema for `custom_schedule.recurring`

Optional:

- `end` (String) The end date of a recurring schedule, provided in ISO 8601 format and set to the UTC timezone. For example: `2025-04-01T00:00:00.000Z`.
- `every` (String) The interval and frequency of a recurring schedule. It allows values in `<integer><unit>` format. `<unit>` is one of `d`, `w`, `M`, or `y` for days, weeks, months, years. For example: `15d`, `2w`, `3m`, `1y`.
- `occurrences` (Number) The total number of recurrences of the schedule.
- `on_month` (List of Number) The specific months for a recurring schedule. Valid values are 1-12.
- `on_month_day` (List of Number) The specific days of the month for a recurring schedule. Valid values are 1-31.
- `on_week_day` (List of String) The specific days of the week (`[MO,TU,WE,TH,FR,SA,SU]`) or nth day of month (`[+1MO, -3FR, +2WE, -4SA, -5SU]`) for a recurring schedule.



<a id="nestedblock--scope"></a>
### Nested Schema for `scope`

Optional:

- `alerting` (Block List, Max: 1) (see [below for nested schema](#nestedblock--scope--alerting))

<a id="nestedblock--scope--alerting"></a>
### Nested Schema for `scope.alerting`

Required:

- `kql` (String) A filter written in Kibana Query Language (KQL).
2 changes: 1 addition & 1 deletion internal/kibana/maintenance_window.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

func validateMinMaintenanceWindowServerVersion(serverVersion *version.Version) diag.Diagnostics {
var maintenanceWindowPublicAPIMinSupportedVersion = version.Must(version.NewVersion("9.1.0"))
var maintenanceWindowPublicAPIMinSupportedVersion = version.Must(version.NewVersion("8.1.0"))
var diags diag.Diagnostics

if serverVersion.LessThan(maintenanceWindowPublicAPIMinSupportedVersion) {
Expand Down