Skip to content

Conversation

@marcabreracast
Copy link
Collaborator

@marcabreracast marcabreracast commented Jan 9, 2026

Description

This PR consolidates and adds module examples across all migration paths in the User Management migration guide. It is a follow-up to PR #4045, using the Org Invitation → Cloud User Org Assignment migration as the reference pattern for consistency.

Module Examples Added

The following migration guides now include module_maintainer/ and module_user/ examples (v1 → v2 → v3):

Migration Guide Resource Changes
Org Invitation to Cloud User Org Assignment mongodbatlas_org_invitationmongodbatlas_cloud_user_org_assignment
Project Teams → Team Project Assignment mongodbatlas_project.teamsmongodbatlas_team_project_assignment
Project Invitation to Cloud User Project Assignment mongodbatlas_project_invitationmongodbatlas_cloud_user_project_assignment
Atlas User/Users Data Sources data.mongodbatlas_atlas_userdata.mongodbatlas_cloud_user_org_assignment
data.mongodbatlas_atlas_usersmongodbatlas_organization.users / mongodbatlas_project.users / mongodbatlas_team.users

Documentation Improvements

  • Team Usernames to Cloud User Team Assignment: Simplified the Module considerations section to adapt to template use in previous PR for guidance.

Example Directory RestructuringMigration examples have been reorganized into the following structure:

  • basic/ - Direct resource usage examples with consolidated README
  • module_maintainer/ - Module developer migration examples
  • module_user/ - Module consumer migration examples
  • README.md - Overview with links to all subdirectories

Basic Example README Consolidation

The following basic/ directories had their version-specific READMEs consolidated into a single parent README for better maintainability:

Example Change
migrate_atlas_user_and_atlas_users/basic/ Consolidated v2/README.md and v3/README.md into basic/README.md
migrate_project_invitation_to_cloud_user_project_assignment/basic/ Consolidated v2/README.md and v3/README.md into basic/README.md

Each consolidated README now documents all migration phases (v1 → v2 → v3) with key attribute changes, usage steps, and expected behavior in a single location.
Link to any related issue(s): CLOUDP-344329

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@marcabreracast marcabreracast force-pushed the CLOUDP-344329_Add_Remaining_Module_Examples branch from 02f70c4 to a4932fc Compare January 9, 2026 11:50
@marcabreracast marcabreracast marked this pull request as ready for review January 9, 2026 16:23
@marcabreracast marcabreracast requested review from a team as code owners January 9, 2026 16:23
Copilot AI review requested due to automatic review settings January 9, 2026 16:23
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

APIx bot: a message has been sent to Docs Slack channel

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates migration documentation and adds comprehensive module examples across all User Management migration paths, following the pattern established in PR #4045.

Changes:

  • Adds module_maintainer/ and module_user/ migration examples (v1→v2→v3) for four migration guides
  • Restructures example directories with basic/, module_maintainer/, and module_user/ subdirectories
  • Consolidates version-specific READMEs in basic examples into single parent READMEs for better maintainability

Reviewed changes

Copilot reviewed 78 out of 115 changed files in this pull request and generated no comments.

Show a summary per file
File Description
examples/migrate_team_project_assignment/v2/README.md Removed standalone README (content moved to basic/README.md)
examples/migrate_team_project_assignment/module_user/* Added module consumer migration examples (v1-v3)
examples/migrate_team_project_assignment/module_maintainer/* Added module developer migration examples (v1-v3)
examples/migrate_team_project_assignment/basic/* Updated to consolidate README and adjust main.tf
examples/migrate_team_project_assignment/README.md Updated to reference restructured subdirectories
examples/migrate_project_invitation_to_cloud_user_project_assignment/v2/README.md Removed standalone README (content moved to basic/README.md)
examples/migrate_project_invitation_to_cloud_user_project_assignment/v3/README.md Removed standalone README (content moved to basic/README.md)
examples/migrate_project_invitation_to_cloud_user_project_assignment/module_user/* Added module consumer migration examples (v1-v3)
examples/migrate_project_invitation_to_cloud_user_project_assignment/module_maintainer/* Added module developer migration examples (v1-v3)
examples/migrate_project_invitation_to_cloud_user_project_assignment/basic/README.md Consolidated version-specific READMEs into single parent README
examples/migrate_project_invitation_to_cloud_user_project_assignment/README.md Updated to reference restructured subdirectories
examples/migrate_atlas_user_and_atlas_users/v2/README.md Removed standalone README (content moved to basic/README.md)
examples/migrate_atlas_user_and_atlas_users/v3/README.md Removed standalone README (content moved to basic/README.md)
examples/migrate_atlas_user_and_atlas_users/module_user/* Added module consumer migration examples (v1-v3)
examples/migrate_atlas_user_and_atlas_users/module_maintainer/* Added module developer migration examples (v1-v3)
examples/migrate_atlas_user_and_atlas_users/basic/README.md Consolidated version-specific READMEs into single parent README
examples/migrate_atlas_user_and_atlas_users/README.md Updated to reference restructured subdirectories
docs/guides/atlas-user-management.md Updated to reference new module examples and simplify documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@erabil-mdb erabil-mdb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! + a few super small suggestions

## Usage

1. Start with v1 to understand the original setup
2. Apply v2 to validate new data sources return expected data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Apply v2 to validate new data sources return expected data
2. Apply v2 to validate that new data sources return expected data

@@ -0,0 +1,27 @@
# Module Maintainer Migration Example

This example demonstrates how module maintainers should migrate from `mongodbatlas_atlas_user` data source to `mongodbatlas_cloud_user_org_assignment`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This example demonstrates how module maintainers should migrate from `mongodbatlas_atlas_user` data source to `mongodbatlas_cloud_user_org_assignment`.
This example demonstrates how module maintainers should migrate from the `mongodbatlas_atlas_user` data source to `mongodbatlas_cloud_user_org_assignment`.

## v1: Initial State

Module using the deprecated `mongodbatlas_atlas_user` data source:
- Complex role filtering with for expressions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Complex role filtering with for expressions
- Complex role filtering with `for` expressions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants