-
Notifications
You must be signed in to change notification settings - Fork 116
[ResponseOps] Maintenance window resource #1224
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
adcoelho
wants to merge
30
commits into
elastic:main
Choose a base branch
from
adcoelho:mw-resource-2.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
b5fa9c4
Maintenance window resource:
adcoelho 8591335
make docs-generate
adcoelho 60c005b
Change float32s to int32s
adcoelho f62cdab
Simplify model code.
adcoelho 882ab65
Resource tests
adcoelho 862b870
Update the changelog.
adcoelho f059ff2
Fix diags and resource tests.
adcoelho a1bb3bf
Missing tests.
adcoelho eb56228
error handling
adcoelho 612bfb7
PR fixes
adcoelho caebd0b
improved documentation
adcoelho d731442
version and serverless checks
adcoelho 07068c7
Addressing PR comments 1
adcoelho b57a8dc
Merge remote-tracking branch 'upstream/main' into mw-resource-2.0
adcoelho 22d0f07
Use EnforceMinVersion in maintenance_window/create.go
adcoelho 164e61e
Generating docs
adcoelho d10d44c
fix linter
adcoelho 6549a9f
Moving validation around.
adcoelho 741a4cf
Merge remote-tracking branch 'upstream/main' into mw-resource-2.0
adcoelho 78afc77
Use terraform-plugin-testing
adcoelho 199d5fa
add iso8601 validation
adcoelho d623300
restructure maintenance window model code
adcoelho bd62e01
call read after update/create
adcoelho ec95b76
fix empty recurring field
adcoelho 0d590bc
fix terraform import
adcoelho 2cc2382
Update internal/kibana/maintenance_window/resource.go
adcoelho 5aad68a
Addressing PR comments 2
adcoelho ea8e074
change schema description
adcoelho 3c96fec
Addressing PR comments.
adcoelho cff95ba
fix tests
adcoelho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ website/node_modules | |
*.test | ||
*.iml | ||
*.vscode | ||
__debug_* | ||
|
||
website/vendor | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
--- | ||
subcategory: "Kibana" | ||
layout: "" | ||
page_title: "Elasticstack: elasticstack_kibana_maintenance_window Resource" | ||
description: |- | ||
Manages Kibana maintenance windows. | ||
--- | ||
|
||
# Resource: elasticstack_kibana_maintenance_window | ||
|
||
Creates and manages Kibana [maintenance windows](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-maintenance-window) | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
provider "elasticstack" { | ||
elasticsearch {} | ||
kibana {} | ||
} | ||
|
||
resource "elasticstack_kibana_maintenance_window" "my_maintenance_window" { | ||
title = "UPDATE TEST" | ||
enabled = true | ||
|
||
custom_schedule = { | ||
start = "1993-01-01T05:00:00.200Z" | ||
duration = "12d" | ||
|
||
recurring = { | ||
every = "21d" | ||
on_week_day = ["MO", "+3TU", "-2FR"] | ||
on_month_day = [1, 2, 4, 6, 7] | ||
on_month = [12] | ||
} | ||
} | ||
|
||
scope = { | ||
alerting = { | ||
kql = "_id: '1234'" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `custom_schedule` (Attributes) A set schedule over which the maintenance window applies. (see [below for nested schema](#nestedatt--custom_schedule)) | ||
- `title` (String) The name of the maintenance window. | ||
|
||
### Optional | ||
|
||
- `enabled` (Boolean) Whether the current maintenance window is enabled. | ||
- `scope` (Attributes) An object that narrows the scope of what is affected by this maintenance window. (see [below for nested schema](#nestedatt--scope)) | ||
- `space_id` (String) An identifier for the space. If space_id is not provided, the default space is used. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Generated ID for the maintenance window. | ||
|
||
<a id="nestedatt--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 days, hours, minutes, seconds. For example: `1d`, `5h`, `30m`, `5000s`. | ||
- `recurring` (Attributes) A set schedule over which the maintenance window applies. (see [below for nested schema](#nestedatt--custom_schedule--recurring)) | ||
- `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: | ||
|
||
- `timezone` (String) The timezone of the schedule. The default timezone is UTC. | ||
|
||
<a id="nestedatt--custom_schedule--recurring"></a> | ||
### Nested Schema for `custom_schedule.recurring` | ||
|
||
Optional: | ||
|
||
- `end` (String) The end 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`. | ||
- `every` (String) The duration of the schedule. It allows values in `<integer><unit>` format. `<unit>` is one of `d`, `h`, `m`, or `s` for days, hours, minutes, seconds. For example: `1d`, `5h`, `30m`, `5000s`. | ||
- `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="nestedatt--scope"></a> | ||
### Nested Schema for `scope` | ||
|
||
Required: | ||
|
||
- `alerting` (Attributes) A set schedule over which the maintenance window applies. (see [below for nested schema](#nestedatt--scope--alerting)) | ||
|
||
<a id="nestedatt--scope--alerting"></a> | ||
### Nested Schema for `scope.alerting` | ||
|
||
Required: | ||
|
||
- `kql` (String) A filter written in Kibana Query Language (KQL). | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import elasticstack_kibana_maintenance_window.my_maintenance_window <space id>/<maintenance window id> | ||
``` |
1 change: 1 addition & 0 deletions
1
examples/resources/elasticstack_kibana_maintenance_window/import.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import elasticstack_kibana_maintenance_window.my_maintenance_window <space id>/<maintenance window id> | ||
27 changes: 27 additions & 0 deletions
27
examples/resources/elasticstack_kibana_maintenance_window/resource.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
provider "elasticstack" { | ||
elasticsearch {} | ||
kibana {} | ||
} | ||
|
||
resource "elasticstack_kibana_maintenance_window" "my_maintenance_window" { | ||
title = "UPDATE TEST" | ||
enabled = true | ||
|
||
custom_schedule = { | ||
start = "1993-01-01T05:00:00.200Z" | ||
duration = "12d" | ||
|
||
recurring = { | ||
every = "21d" | ||
on_week_day = ["MO", "+3TU", "-2FR"] | ||
on_month_day = [1, 2, 4, 6, 7] | ||
on_month = [12] | ||
} | ||
} | ||
|
||
scope = { | ||
alerting = { | ||
kql = "_id: '1234'" | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.