Skip to content

Conversation

oarbusi
Copy link
Collaborator

@oarbusi oarbusi commented Aug 20, 2025

Description

Migration guide for mongodbatlas_project_invitation resource and data source to the mongodbatlas_cloud_user_project_assignment resource

Link to any related issue(s): CLOUDP-336762

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

@oarbusi oarbusi marked this pull request as ready for review August 21, 2025 09:48
@Copilot Copilot AI review requested due to automatic review settings August 21, 2025 09:48
@oarbusi oarbusi requested review from a team as code owners August 21, 2025 09:48
Copy link
Contributor

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

Copy link
Contributor

@Copilot 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 creates comprehensive documentation and examples for migrating from the deprecated mongodbatlas_project_invitation resource to the new mongodbatlas_cloud_user_project_assignment resource. The migration addresses the transition from managing pending invitations to managing active project memberships.

  • Adds a complete migration guide with step-by-step instructions for handling pending invitations
  • Creates three-phase example configurations (v1: deprecated resource, v2: migration phase, v3: final state)
  • Updates documentation templates and existing resource documentation with proper migration guide links

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/guides/project-invitation-to-cloud-user-project-assignment-migration-guide.md Main migration guide with detailed instructions and examples
examples/migrate_project_invitation_to_cloud_user_project_assignment/ Complete example configurations demonstrating the three-phase migration approach
templates/resources/cloud_user_project_assignment.md.tmpl Updates placeholder link to point to the actual migration guide
templates/data-sources/cloud_user_project_assignment.md.tmpl Updates placeholder link to point to the actual migration guide
docs/resources/project_invitation.md Adds deprecation notice with migration guide reference
docs/data-sources/project_invitation.md Adds deprecation notice with migration guide reference
docs/resources/cloud_user_project_assignment.md Updates placeholder link to point to the actual migration guide
docs/data-sources/cloud_user_project_assignment.md Updates placeholder link to point to the actual migration guide

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@AgustinBettati AgustinBettati left a comment

Choose a reason for hiding this comment

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

LGTM


## Migrating PENDING invitation (resource exists in config)

Original configuration (note: `user_id` does not exist on `mongodbatlas_project_invitation`):
Copy link
Member

Choose a reason for hiding this comment

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

curious why this clarification of user_id is needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not needed here, was a left over when copying a section from other migration guide. good catch

### v2: Migration Phase (Re-creation with Removed Block)
Demonstrates the migration approach:
- Adds new `mongodbatlas_cloud_user_project_assignment` resource
- Uses `removed` block to cleanly remove old resource from state
Copy link
Member

Choose a reason for hiding this comment

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

q: Does migration work if old mongodbatlas_project_invitation is directly removed, calling a delete? Just checking if the migration can be even more simple

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it would work deleting the resource directly. In my opinion, this could raise concerns in customers doing the migration and could add a bit of friction to entirely destroy/delete the invitation. Removing it from the state is less definitive and less "scary"

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!

@oarbusi oarbusi merged commit 181a4ba into CLOUDP-320243-dev-2.0.0 Aug 22, 2025
42 checks passed
@oarbusi oarbusi deleted the CLOUDP-336762 branch August 22, 2025 07:58
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