Skip to content

feat: Adds cloud backup collection restore job resource - #4669

Merged
EspenAlbert merged 8 commits into
CLOUDP-433211_query-param-supportfrom
CLOUDP-435981_collection-restore-autogen
Aug 26, 2026
Merged

feat: Adds cloud backup collection restore job resource#4669
EspenAlbert merged 8 commits into
CLOUDP-433211_query-param-supportfrom
CLOUDP-435981_collection-restore-autogen

Conversation

@EspenAlbert

@EspenAlbert EspenAlbert commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Description

Enables mongodbatlas_cloud_backup_collection_restore_job and related data sources from autogen config.yml: the create-only restore job resource, job/collection data sources, and snapshot database/collection data sources. Registers them in the provider. Jobs are immutable and have no public DELETE.

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

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 fix and verified 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

Create wait uses error_description_property: errorMessage (3h timeout). Changelog placeholder is .changelog/9999.txt and should be renamed to this PR number before merge.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds new Atlas Cloud Backup collection-level restore job support to the provider by wiring in a create-only resource plus several related data sources generated from tools/codegen/config.yml.

Changes:

  • Introduces mongodbatlas_cloud_backup_collection_restore_job (create + read, no update, no API delete) with async wait handling.
  • Adds data sources for restore jobs (singular + plural), restore-job collection states (singular + plural), and snapshot namespace discovery (databases + collections).
  • Registers the new resource/data sources in the provider and adds a changelog entry.

Reviewed changes

Copilot reviewed 7 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/codegen/models/cloud_backup_snapshot_database.yaml New codegen model for snapshot database listing DS.
tools/codegen/models/cloud_backup_snapshot_database_collection.yaml New codegen model for snapshot database collections listing DS.
tools/codegen/models/cloud_backup_collection_restore_job.yaml New codegen model for the collection restore job resource + DS.
tools/codegen/models/cloud_backup_collection_restore_job_collection.yaml New codegen model for restore-job collection state DS (singular + plural).
tools/codegen/config.yml Adds config entries/overrides/aliases for the new resource and data sources.
internal/serviceapi/cloudbackupsnapshotdatabasecollection/plural_data_source.go Generated plural DS implementation for snapshot database collections.
internal/serviceapi/cloudbackupsnapshotdatabasecollection/plural_data_source_schema.go Generated schema/model for snapshot database collections plural DS.
internal/serviceapi/cloudbackupsnapshotdatabase/plural_data_source.go Generated plural DS implementation for snapshot databases.
internal/serviceapi/cloudbackupsnapshotdatabase/plural_data_source_schema.go Generated schema/model for snapshot databases plural DS.
internal/serviceapi/cloudbackupcollectionrestorejobcollection/plural_data_source.go Generated plural DS implementation for restore-job collection states.
internal/serviceapi/cloudbackupcollectionrestorejobcollection/plural_data_source_schema.go Generated schema/model for restore-job collection states plural DS.
internal/serviceapi/cloudbackupcollectionrestorejobcollection/data_source.go Generated singular DS implementation for a restore-job collection state.
internal/serviceapi/cloudbackupcollectionrestorejobcollection/data_source_schema.go Generated schema/model for restore-job collection state singular DS.
internal/serviceapi/cloudbackupcollectionrestorejob/resource.go Generated resource implementation (create/read + wait, update error, delete no-op).
internal/serviceapi/cloudbackupcollectionrestorejob/resource_schema.go Generated resource schema for restore job inputs/outputs.
internal/serviceapi/cloudbackupcollectionrestorejob/plural_data_source.go Generated plural DS implementation for restore jobs.
internal/serviceapi/cloudbackupcollectionrestorejob/plural_data_source_schema.go Generated schema/model for restore jobs plural DS.
internal/serviceapi/cloudbackupcollectionrestorejob/data_source.go Generated singular DS implementation for a restore job.
internal/serviceapi/cloudbackupcollectionrestorejob/data_source_schema.go Generated schema/model for restore job singular DS.
internal/provider/provider.go Registers the new resource and data sources in the provider.
.changelog/9999.txt Adds release-note entries for the new resource and data sources (placeholder filename).
Files not reviewed (14)
  • internal/serviceapi/cloudbackupcollectionrestorejob/data_source.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejob/data_source_schema.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejob/plural_data_source.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejob/plural_data_source_schema.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejob/resource.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejob/resource_schema.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejobcollection/data_source.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejobcollection/data_source_schema.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejobcollection/plural_data_source.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejobcollection/plural_data_source_schema.go: Generated file
  • internal/serviceapi/cloudbackupsnapshotdatabase/plural_data_source.go: Generated file
  • internal/serviceapi/cloudbackupsnapshotdatabase/plural_data_source_schema.go: Generated file
  • internal/serviceapi/cloudbackupsnapshotdatabasecollection/plural_data_source.go: Generated file
  • internal/serviceapi/cloudbackupsnapshotdatabasecollection/plural_data_source_schema.go: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/serviceapi/cloudbackupcollectionrestorejob/resource.go
Comment thread internal/provider/provider.go
Comment thread .changelog/4669.txt
@EspenAlbert
EspenAlbert force-pushed the CLOUDP-435981_collection-restore-autogen branch from 185863a to 49513c1 Compare August 24, 2026 09:21
@EspenAlbert
EspenAlbert marked this pull request as ready for review August 24, 2026 09:50
@EspenAlbert
EspenAlbert requested review from a team as code owners August 24, 2026 09:50
@EspenAlbert
EspenAlbert requested a lite review from Copilot August 24, 2026 09:50
@github-actions

Copy link
Copy Markdown
Contributor

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

@augmentcode

augmentcode Bot commented Aug 24, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR enables Terraform support for Atlas collection-level cloud backup restores.

Changes:

  • Registers a create-only collection restore-job resource in the provider.
  • Adds singular and plural data sources for restore jobs and per-collection restore status.
  • Adds snapshot database and database-collection discovery data sources for selecting restore namespaces.
  • Generates Framework schemas and API call implementations for all new surfaces.
  • Configures the Atlas API version header as 2025-03-12.
  • Defines a three-hour create wait that polls job state through successful completion.
  • Uses a no-op Terraform delete because this API exposes no public job deletion or cancellation.
  • Adds codegen configuration and generated model definitions, including API field aliases and namespace descriptions.
  • Adds release notes for the resource and six data sources.
Technical Notes: Optional/computed fields accommodate Atlas defaults and server-populated PIT/snapshot values; immutable identity and strategy fields use create-only plan modifiers.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 21 changed files in this pull request and generated no new comments.

Files not reviewed (14)
  • internal/serviceapi/cloudbackupcollectionrestorejob/data_source.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejob/data_source_schema.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejob/plural_data_source.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejob/plural_data_source_schema.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejob/resource.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejob/resource_schema.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejobcollection/data_source.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejobcollection/data_source_schema.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejobcollection/plural_data_source.go: Generated file
  • internal/serviceapi/cloudbackupcollectionrestorejobcollection/plural_data_source_schema.go: Generated file
  • internal/serviceapi/cloudbackupsnapshotdatabase/plural_data_source.go: Generated file
  • internal/serviceapi/cloudbackupsnapshotdatabase/plural_data_source_schema.go: Generated file
  • internal/serviceapi/cloudbackupsnapshotdatabasecollection/plural_data_source.go: Generated file
  • internal/serviceapi/cloudbackupsnapshotdatabasecollection/plural_data_source_schema.go: Generated file

@jromo-mdb jromo-mdb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread tools/codegen/config.yml Outdated
@EspenAlbert
EspenAlbert force-pushed the CLOUDP-435981_collection-restore-autogen branch 2 times, most recently from 76698d5 to ebda5f7 Compare August 25, 2026 16:33

@AgustinBettati AgustinBettati left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM just want to double check the query param attributes

Comment thread tools/codegen/config.yml Outdated
Comment on lines +19 to +22
# ApiAtlasRestoreNamespaceView is shared by databases and collections, so the spec
# description ("database name or database.collection") is stamped onto both lists.
# MMS validates them differently: database name vs `database.collection`.
# TODO: request sibling descriptions on the two parent properties in OpenAPI, then drop these overrides.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

would not mention these implementation details, is there a CLOUDP we can place here for tracking the docs fix?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Tracked in CLOUDP-439020. Replaced the comment with a TODO pointing at that ticket.

@EspenAlbert
EspenAlbert force-pushed the CLOUDP-435981_collection-restore-autogen branch 2 times, most recently from 2eca302 to 7ec2cae Compare August 26, 2026 12:21
@EspenAlbert
EspenAlbert changed the base branch from CLOUDP-435981_autogen-wait-error-description to CLOUDP-433211_query-param-support August 26, 2026 12:24
@EspenAlbert
EspenAlbert force-pushed the CLOUDP-435981_collection-restore-autogen branch from 7ec2cae to 25642ea Compare August 26, 2026 12:28

@AgustinBettati AgustinBettati left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

EspenAlbert and others added 4 commits August 26, 2026 14:39
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ilters

Co-authored-by: Cursor <cursoragent@cursor.com>
@EspenAlbert
EspenAlbert force-pushed the CLOUDP-435981_collection-restore-autogen branch from 59a3a73 to ac5ef74 Compare August 26, 2026 13:39
@EspenAlbert
EspenAlbert merged commit e81086d into master Aug 26, 2026
105 checks passed
@EspenAlbert
EspenAlbert deleted the CLOUDP-435981_collection-restore-autogen branch August 26, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants