feat: Adds cloud backup collection restore job resource - #4669
Conversation
There was a problem hiding this comment.
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.
185863a to
49513c1
Compare
|
APIx bot: a message has been sent to Docs Slack channel |
🤖 Augment PR SummarySummary: This PR enables Terraform support for Atlas collection-level cloud backup restores.
🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
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
76698d5 to
ebda5f7
Compare
AgustinBettati
left a comment
There was a problem hiding this comment.
LGTM just want to double check the query param attributes
| # 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. |
There was a problem hiding this comment.
would not mention these implementation details, is there a CLOUDP we can place here for tracking the docs fix?
There was a problem hiding this comment.
Tracked in CLOUDP-439020. Replaced the comment with a TODO pointing at that ticket.
2eca302 to
7ec2cae
Compare
7ec2cae to
25642ea
Compare
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>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…sent Co-authored-by: Cursor <cursoragent@cursor.com>
59a3a73 to
ac5ef74
Compare
Description
Enables
mongodbatlas_cloud_backup_collection_restore_joband related data sources from autogenconfig.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:
Required Checklist:
Further comments
Create wait uses
error_description_property: errorMessage(3h timeout). Changelog placeholder is.changelog/9999.txtand should be renamed to this PR number before merge.