doc: DOCSP-60307 -- [TF] Maintenance Performed on Non-Prod User Projects Before Prod - #4508
Conversation
|
APIx bot: a message has been sent to Docs Slack channel |
There was a problem hiding this comment.
Pull request overview
This PR updates the provider documentation to describe Atlas maintenance wave assignment behavior, including newly documented wave_assignment / effective_wave_assignment fields on maintenance windows, and adds new docs pages for an organization-level maintenance settings resource and data source.
Changes:
- Add documentation pages for
mongodbatlas_org_maintenance_settings(resource + data source). - Document maintenance window wave assignment fields (
wave_assignment,effective_wave_assignment) in both the resource and data source docs. - Add additional explanatory text describing when the effective wave assignment may differ from the explicit assignment.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| docs/resources/org_maintenance_settings.md | Adds resource documentation for org-level maintenance wave assignment mode. |
| docs/data-sources/org_maintenance_settings.md | Adds data source documentation for reading org-level maintenance wave assignment mode. |
| docs/resources/maintenance_window.md | Documents new maintenance window wave assignment argument and effective wave attribute. |
| docs/data-sources/maintenance_window.md | Documents new maintenance window wave assignment and effective wave attributes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `effective_wave_assignment` - The maintenance wave Atlas uses when scheduling maintenance for this project. This value can differ from `wave_assignment` in the following scenarios: | ||
| - **`ENV_TAG_MAPPING` mode is active at the organization level.** When the organization's `wave_assignment_mode` is set to `ENV_TAG_MAPPING` (see [`mongodbatlas_org_maintenance_settings`](org_maintenance_settings.md)), Atlas ignores any explicit `wave_assignment` and derives the effective wave from the project's environment tag. A project can have `wave_assignment = 1` in state while `effective_wave_assignment` returns a different value. | ||
| - **Cross-organization billing (`MAINTENANCE_SEQUENCE_CROSS_ORG`).** A linked non-paying organization inherits the paying organization's wave assignment mode. If the paying organization switches to `ENV_TAG_MAPPING`, all linked projects follow regardless of any explicit `wave_assignment` set on them. |
There was a problem hiding this comment.
To be added by engineering
There was a problem hiding this comment.
corryroot
left a comment
There was a problem hiding this comment.
LGTM! I commented with some copy nits.
|
Note as discussed with @xargom earlier: changes should be merged into branch Once all the changes are ready, a final PR will be created to merge to |
Base branch changed |
…ce_window and add org_maintenance_settings resource and data source docs
Co-authored-by: corryroot <72401712+corryroot@users.noreply.github.com>
…ment from resource doc, deletes explicit values for wave:assignment, and fix null-assignment language
…_maintenance_settings.md
…ds, drops $ and specifies shell language
| terraform import mongodbatlas_org_maintenance_settings.example 5d09d6a59ccf6445652a444a | ||
| ``` | ||
|
|
||
| For more information see: [MongoDB Atlas API Reference.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/group/endpoint-maintenance-windows) |
| `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`. |
There was a problem hiding this comment.
Remove this attribute from your configuration and run
terraform applyto reset the mode toMANUAL
Regarding resetting the field again to MANUAL there is currently https://jira.mongodb.org/browse/CLOUDP-415703 to address this behaviour.
There was a problem hiding this comment.
Updated to consider new behaviour
|
|
||
| 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. |
There was a problem hiding this comment.
Defaults to
MANUALwhen unset.
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.
|
|
||
| ### Further Examples | ||
|
|
||
| <!-- TODO(CLOUDP-414003): Add link to examples once Mar's examples land --> |
There was a problem hiding this comment.
FYI, examples will be merged in this PR: #4531
There was a problem hiding this comment.
Waiting for PR to merge to incorporate here.
| 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. | ||
| * `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). |
There was a problem hiding this comment.
For more details, see the
mongodbatlas_maintenance_windowdata source.
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?
"In a cross-organization billing hierarchy, a linked non-paying organization cannot update its
effectiveWaveAssignmentModefield, which inherits from the paying organization'swaveAssignmentMode. In this case, a linked non-paying organization'seffectiveWaveAssignmentModeandwaveAssignmentModemight differ."
Proposed change, but feel free to adapt it to better wording:
effective_wave_assignment_mode- Wave assignment mode Atlas uses for scheduling. Matcheswave_assignment_modeexcept in a cross-organization billing hierarchy where this is a linked non-paying organization. In that case,effective_wave_assignment_modeinherits from the paying organization'swave_assignment_modeand the two values might differ.
There was a problem hiding this comment.
Changed to the proposed copy
marcabreracast
left a comment
There was a problem hiding this comment.
LGTM after latest comments have been addressed. We can merge this PR after the examples one is available in the dev branch if you agree.
Good work!
…. Adds details on when effective wave assignment mode differs from wave assignment mode
865eb69
into
dev/CLOUDP-306618_Maintenance_Waves_Non_Prod
* feat: Add wave_assignment field to mongodbatlas_maintenance_window resource (#4510) * Add new fields to resource * Add new resource field to CREATE * Add new fields to resource READ * WIP: null value * Remove nil guard * Add acceptance tests * Remove effective_wave_maintenance field from resource * Add additional step to ensure other values are not modified after PATCH * Add changelog * Add method to distinguish between 0 and unset value edge case * Reword comment * Add distinction between 0 and unset * Rephrase comment for better clarification * feat: Add wave_assignment and effective_wave_assignment fields to mongodbatlas_maintenance_window data source (#4512) * Add fields to schema * Remove nil guard since it's not needed * Add acceptance tests * Address format consistency * Add changelog * Fix changelog entry to use attribute instead of field * Address PR comments to align test structure in resource to best practices * chore: Pin SDK v20250312020 for maintenance_window wave assignment fields (#4529) * Pin SDK v20250312020 for maintenance_window wave assignment fields * Add comment explaining SkipTestForCI for wave assignment test * Refine comment * Add TODO to SkipTestForCI comment * feat: Add mongodbatlas_org_maintenance_settings resource (#4513) * Add configuration for autogen resource * Drop _api wording to match prod naming resources * Add autogenerated resource * Update version header to use preview version * Register resource in the provider * Add Computed to field to avoid inconsistency issues due to DELETE * Add acceptance tests for org_maintenance_settings resource * Fix import step to ignore wave_assignment_mode verification * Add changelog entry for org_maintenance_settings resource * Add notes to config.yaml for follow-up * Refine acceptance tests * Remove ignore import test * Add clarifying comment * Edit changelog to match format * Override org_id description * feat: Add mongodbatlas_org_maintenance_settings data source (#4527) * Add configuration for autogen resource * Drop _api wording to match prod naming resources * Add autogenerated resource * Update version header to use preview version * Register resource in the provider * Add Computed to field to avoid inconsistency issues due to DELETE * Add acceptance tests for org_maintenance_settings resource * Fix import step to ignore wave_assignment_mode verification * Add changelog entry for org_maintenance_settings resource * Add notes to config.yaml for follow-up * Refine acceptance tests * Remove ignore import test * Configure and generate data source * Register Data Source in provider * Add aceptance tests * Add changelog entry for org_maintenance_settings data source * Edit changelog * Fix previous changelog from conflict * Override org_id schema description * Re-enable wave assignment acceptance test (#4535) * doc: DOCSP-60307 -- [TF] Maintenance Performed on Non-Prod User Projects Before Prod (#4508) * doc: DOCSP-60307 -- Document wave_assignment attributes for maintenance_window and add org_maintenance_settings resource and data source docs * doc: DOCSP-60307 -- updates link * Apply suggestions from code review Co-authored-by: corryroot <72401712+corryroot@users.noreply.github.com> * doc: DOCSP-60307 -- Address PR feedback: remove effective_wave_assignment from resource doc, deletes explicit values for wave:assignment, and fix null-assignment language * doc: DOCSP-60307 -- Replaces link for plaintext in docs/resources/org_maintenance_settings.md * doc: DOCSP-60307 -- Updates field descriptions to align with upstream changes in CLOUDP-414939 * doc: DOCSP-60307 -- Copy changes. Updates broken links * doc: DOCSP-60307 -- Copy changes * doc: DOCSP-60307 -- Fixes broken link * doc: DOCSP-60307 -- Fixes broken link. Raplaces null for 0. In commands, drops $ and specifies shell language * doc: DOCSP-60307 -- Fixes typos and improves copy * doc: DOCSP-60307 -- Addresses wave_assignment_mode behaviour according to CLOUDP-415703 * doc: DOCSP-60307 -- Small copy change * doc: DOCSP-60307 -- Adds newline * DOCSP-60307 -- Drops default to manual for wave assignment mode field. Adds details on when effective wave assignment mode differs from wave assignment mode * doc: DOCSP-60307 -- Adds tag key information for ENV_TAG_MAPPING mode * doc: DOCSP--60307 -- Adds examples in org maintenance settings resource --------- Co-authored-by: corryroot <72401712+corryroot@users.noreply.github.com> * doc: Add examples for maintenance window wave assignment and org maintenance settings (#4531) * Add example for maintenance_window * Add example for org_maintenance_settings * Refine example for consistency * Refine example * Refine ENV_TAG_MAPPING example * Restructure examples to leave maintenance_window example basic * Remove wave_assignment example * Add tag mapping values to example * Apply nit suggestion Co-authored-by: Javier Armendáriz <136641722+xargom@users.noreply.github.com> --------- Co-authored-by: Javier Armendáriz <136641722+xargom@users.noreply.github.com> * chore: Improvements on mongodbatlas_org_maintenance_settings resource after API improvements (#4536) * update destroy operation to use custom reset method * Remove override for wave_assignment_mode being Computed * Capture attribute description from autogen * Add flattened spec for internal OpenAPI * Fix tests * test: Add comment to PlanOnly step and remove redundant ENV_TAG_MAPPING plan check * Fix typo * Fix typo * Update comment * test: Enable org_maintenance_settings acceptance tests in CI (#4562) * Remove TODO as CLOUDP has been merged * Add acceptance tests to CI * Replace pinned SDK version with private preview (#4569) * fix: Resolve merge conflict leaving aimodelapikey and projectserviceaccount schemas out of sync with docs * refactor: Replace clearMaintenanceWave workaround with SDK NullFields (#4691) * Remove workaround * Address PR comment * feat: Support maintenance wave assignment without a maintenance window (#4687) * Update attributes to Optional to match API spec * Update CRUD for fields * Add acceptance tests to cover new use case * Update docs * Remove validation functions in favor of API validation * Pin preview version to get latest changes * chore: Add changelog entry * Add plan validator for required attributes * Add assertion to test * Add test coverage for plan only validator of dayOfWeek and hourOfDay attributes * Add comment suggestion * chore: Clear maintenance schedule on wave-only transition (#4716) * Add functionality to allow fields to be null * Fix issue where Update did not perform a follow-up read * chore: Add changelog entry for #4716 * chore: Remove unnecessary changelog entry for unreleased feature work * Address PR comments * Remove comments * Update resource and data source with stable API version * Update link version * chore: Update API spec for org_maintenance_settings stable version Pins the atlasapispec to the spec where maintenanceSettings exposes the 2025-03-12 media type, matching the generated code and config.yml version_header so the autogen consistency check passes. Also points the Further Examples links for org_maintenance_settings at tree/master. * chore: Restore ai_model_api_key and stream_connection_failover models from master These model YAMLs carried stale-merge divergence (a changed description in ai_model_api_key and 246 extra lines in stream_connection_failover), making the autogen code-gen check regenerate different schemas than committed. Restoring master's versions aligns the models so the check stays stable. * chore: Restore go.mod and go.sum dependency pins from master --------- Co-authored-by: Javier Armendáriz <136641722+xargom@users.noreply.github.com> Co-authored-by: corryroot <72401712+corryroot@users.noreply.github.com> Co-authored-by: svc-apix-bot <svc-api-experience-integrations-escalation@mongodb.com> Co-authored-by: Aastha Mahendru <aastha.mahendru@mongodb.com> Co-authored-by: Agustin Bettati <bettatiagustin@gmail.com> Co-authored-by: Oriol Arbusi Abadal <oriol.abadal@mongodb.com>
Description
Documents the Atlas maintenance waves feature for the Terraform provider. Maintenance waves allow Atlas to sequence cluster maintenance across projects in an organization — non-production projects are updated first, production projects last.
Related ticket: DOCSP-60307
Engineering implementation: CLOUDP-397100
Examples (in progress): CLOUDP-414003
Changes
docs/resources/maintenance_window.md— Addedwave_assignmentargument andeffective_wave_assignmentcomputed attribute. Includes a dedicated note on the two divergence scenarios whereeffective_wave_assignmentcan differ fromwave_assignment:ENV_TAG_MAPPINGmode active at the org level, and cross-organization billing (MAINTENANCE_SEQUENCE_CROSS_ORG).docs/data-sources/maintenance_window.md— Addedwave_assignmentandeffective_wave_assignmentattributes with matching divergence note.docs/resources/org_maintenance_settings.md— New resource doc formongodbatlas_org_maintenance_settings. Manages org-level wave assignment mode (MANUALorENV_TAG_MAPPING). Singleton per organization.docs/data-sources/org_maintenance_settings.md— New data source doc formongodbatlas_org_maintenance_settings. Exposeswave_assignment_modeandeffective_wave_assignment_mode.Type of change:
Required Checklist:
Further comments
The Further Examples link in
org_maintenance_settings.mdpoints tomasteras a placeholder. Update to a versioned URL once Mar's example files from CLOUDP-414003 are merged.