-
Notifications
You must be signed in to change notification settings - Fork 215
doc: DOCSP-60307 -- [TF] Maintenance Performed on Non-Prod User Projects Before Prod #4508
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
Changes from 9 commits
69f9fbc
5d3ec4e
20c1ce5
013cde1
778e802
2c99808
188ff38
4c5c405
c43e22a
94f92d8
7a64187
9f93ba9
41b6ef0
6dedf22
932eabc
14e3a23
ee210f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| subcategory: "Organizations" | ||
| --- | ||
|
|
||
| # Data Source: mongodbatlas_org_maintenance_settings | ||
|
|
||
| `mongodbatlas_org_maintenance_settings` provides a data source to read the organization-level [maintenance wave settings](https://www.mongodb.com/docs/atlas/tutorial/cluster-maintenance-window/) for a MongoDB Atlas organization. | ||
|
|
||
|
xargom marked this conversation as resolved.
|
||
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| data "mongodbatlas_org_maintenance_settings" "example" { | ||
| org_id = var.org_id | ||
| } | ||
|
|
||
| output "maintenance_settings" { | ||
| value = { | ||
| wave_assignment_mode = data.mongodbatlas_org_maintenance_settings.example.wave_assignment_mode | ||
| effective_wave_assignment_mode = data.mongodbatlas_org_maintenance_settings.example.effective_wave_assignment_mode | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Argument Reference | ||
|
|
||
| * `org_id` - (Required) Unique 24-hexadecimal digit string that identifies the Atlas organization. | ||
|
|
||
| ## Attributes Reference | ||
|
|
||
| In addition to all arguments above, the following attributes are exported: | ||
|
|
||
| * `wave_assignment_mode` - Configured wave assignment mode for the organization. Accepted values are `MANUAL` and `ENV_TAG_MAPPING`. Defaults to `MANUAL` when unset. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This was the initial behaviour, however CLOUDP-415703 intends to drop the default value since it's a client field. I'd drop that phrase if you agree.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dropped |
||
| * `effective_wave_assignment_mode` - Wave assignment mode Atlas actually uses for scheduling. Its value can differ from `wave_assignment_mode` in some cases. For more details, see the [`mongodbatlas_maintenance_window` data source](../data-sources/maintenance_window.md). | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I believe we should specify the scenarios where this divergence can happen. Upstream team updated the docs as it follows for the API behaviour, can we adapt those for the Terraform field?
Proposed change, but feel free to adapt it to better wording:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed to the proposed copy |
||
|
|
||
| For more information see: [MongoDB Atlas API Reference.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/group/endpoint-maintenance-windows) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| --- | ||
| subcategory: "Organizations" | ||
| --- | ||
|
|
||
| # Resource: mongodbatlas_org_maintenance_settings | ||
|
|
||
| `mongodbatlas_org_maintenance_settings` provides a resource to manage organization-level maintenance wave settings for a MongoDB Atlas organization. Use this resource to control how [Atlas assigns projects to maintenance waves](https://www.mongodb.com/docs/atlas/tutorial/cluster-maintenance-window/), either explicitly by project (`MANUAL` mode) or automatically based on each project's environment tag (`ENV_TAG_MAPPING` mode). | ||
|
|
||
| -> **NOTE:** Only one `mongodbatlas_org_maintenance_settings` resource can be defined per organization. | ||
|
xargom marked this conversation as resolved.
|
||
|
|
||
| ## Example Usage | ||
|
|
||
| ### Manual wave assignment | ||
|
|
||
| Set the organization to `MANUAL` mode so you can assign each project to a specific maintenance wave using the `wave_assignment` attribute on [`mongodbatlas_maintenance_window`](maintenance_window.md). | ||
|
|
||
| ```terraform | ||
| resource "mongodbatlas_org_maintenance_settings" "example" { | ||
| org_id = var.org_id | ||
| wave_assignment_mode = "MANUAL" | ||
| } | ||
| ``` | ||
|
|
||
| ### Automatic wave assignment based on environment tags | ||
|
|
||
| Set the organization to `ENV_TAG_MAPPING` mode to have Atlas derive the maintenance wave from each project's environment tag. | ||
|
|
||
| ```terraform | ||
| resource "mongodbatlas_org_maintenance_settings" "example" { | ||
| org_id = var.org_id | ||
| wave_assignment_mode = "ENV_TAG_MAPPING" | ||
| } | ||
| ``` | ||
|
|
||
| ### Further Examples | ||
|
|
||
| <!-- TODO(CLOUDP-414003): Add link to examples once Mar's examples land --> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI, examples will be merged in this PR: #4531
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Waiting for PR to merge to incorporate here. |
||
| Configure Organization Maintenance Settings | ||
|
|
||
|
xargom marked this conversation as resolved.
|
||
| ## Argument Reference | ||
|
|
||
| `mongodbatlas_org_maintenance_settings` supports the following arguments: | ||
|
|
||
| * `org_id` - (Required) Unique 24-hexadecimal digit string that identifies the Atlas organization. This attribute cannot be changed after the resource is created. | ||
| * `wave_assignment_mode` - (Optional) Controls how Atlas assigns projects to maintenance waves. Accepted values are `MANUAL` and `ENV_TAG_MAPPING`. Remove this attribute from your configuration and run `terraform apply` to reset the mode to `MANUAL`. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Regarding resetting the field again to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to consider new behaviour |
||
|
|
||
| ## Import | ||
|
|
||
| Organization maintenance settings can be imported using the organization ID, in the format `ORG_ID`, e.g. | ||
|
|
||
| ``` | ||
| $ terraform import mongodbatlas_org_maintenance_settings.example 5d09d6a59ccf6445652a444a | ||
| ``` | ||
|
|
||
| For more information see: [MongoDB Atlas API Reference.](https://www.mongodb.com/docs/atlas/reference/api/maintenance-windows/) | ||
Uh oh!
There was an error while loading. Please reload this page.