-
Notifications
You must be signed in to change notification settings - Fork 190
feat: Adds protected_hours
and time_zone_id
to mongodbatlas_maintenance_window
#3195
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c6a27bb
example
maastha 3e55caa
init resource changes
maastha acefbe3
minor
maastha 331675f
docs
maastha 4a4a577
Merge branch 'master' into CLOUDP-291819-maintenance-window
EspenAlbert 27b7dea
fix lint error
EspenAlbert 65f7a09
feat: Enhance maintenance window tests with protected hours configura…
EspenAlbert 65b98e0
test: Fix broken migration test
EspenAlbert e783616
fix: example maintenance window
EspenAlbert 7b86a49
test: Add check for time_zone_id in auto defer activated test (alread…
EspenAlbert a8fff04
feat: Add release notes for `protected_hours` and `time_zone_id` in m…
EspenAlbert 3bd6f5c
apply PR doc suggestions
EspenAlbert 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
```release-note:enhancement | ||
resource/mongodbatlas_maintenance_window: Adds `protected_hours` and `time_zone_id` | ||
``` | ||
|
||
```release-note:enhancement | ||
data-source/mongodbatlas_maintenance_window: Adds `protected_hours` and `time_zone_id` | ||
``` |
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
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,11 @@ | ||
# MongoDB Atlas Provider - Configure Maintenance Window | ||
|
||
This example demonstrates how to configure maintenance windows for your Atlas project in Terraform. | ||
|
||
Required variables to set: | ||
|
||
- `public_key`: Atlas public key | ||
- `private_key`: Atlas private key | ||
- `org_id`: Unique 24-hexadecimal digit string that identifies the organization that contains the project and cluster. | ||
|
||
For additional information you can visit the [Maintenance Window Documentation](https://www.mongodb.com/docs/atlas/tutorial/cluster-maintenance-window/). |
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,23 @@ | ||
resource "mongodbatlas_project" "example" { | ||
name = "project-name" | ||
org_id = var.org_id | ||
} | ||
|
||
resource "mongodbatlas_maintenance_window" "example" { | ||
project_id = mongodbatlas_project.example.id | ||
auto_defer_once_enabled = true | ||
hour_of_day = 23 | ||
day_of_week = 1 | ||
protected_hours { | ||
start_hour_of_day = 9 | ||
end_hour_of_day = 17 | ||
} | ||
} | ||
|
||
data "mongodbatlas_maintenance_window" "example" { | ||
project_id = mongodbatlas_maintenance_window.example.project_id | ||
} | ||
|
||
output "time_zone_id" { | ||
value = data.mongodbatlas_maintenance_window.example.time_zone_id | ||
} |
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,4 @@ | ||
provider "mongodbatlas" { | ||
public_key = var.public_key | ||
private_key = var.private_key | ||
} |
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,12 @@ | ||
variable "public_key" { | ||
description = "Public API key to authenticate to Atlas" | ||
type = string | ||
} | ||
variable "private_key" { | ||
description = "Private API key to authenticate to Atlas" | ||
type = string | ||
} | ||
variable "org_id" { | ||
description = "Atlas Organization ID" | ||
type = string | ||
} |
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,9 @@ | ||
terraform { | ||
required_providers { | ||
mongodbatlas = { | ||
source = "mongodb/mongodbatlas" | ||
version = "~> 1.0" | ||
} | ||
} | ||
required_version = ">= 1.0" | ||
} |
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we document the default protected hours value if not specified? is it 0,0 the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I asked on the ticket.
My guess is that it will be empty (no protected hours)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also I don't know if there is a limit, e.g. can you set the 24h as protected? (i guess not because then maintenance can't happen). maybe we can reference some official doc for more info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a link 20 lines below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, thanks, and the answer is there: The length of your protected hours window cannot exceed 18 hours.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upstream replied that they have an internal default.