published on Friday, Aug 28, 2026 by Pulumi
published on Friday, Aug 28, 2026 by Pulumi
mongodbatlas.getCloudBackupCollectionRestoreJobCollection describes the restore state of one collection in a collection restore job.
To use this data source, the requesting Service Account or API Key must have the Backup Manager or Project Owner role.
Note: This data source returns no collection state while the job is
INITIALIZING. Collection states exist after the job entersIN_PROGRESS.
Example Usage
The following example lists per-collection restore state for a job, then reads one collection by sourceNamespace. When sourceNamespace is omitted, the example defaults to the last namespace from the plural data source.
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
import * as std from "@pulumi/std";
// Per-collection read-back for the resolved collection restore job.
const _this = mongodbatlas.getCloudBackupCollectionRestoreJobCollections({
projectId: projectId,
clusterName: clusterName,
jobId: jobId,
});
const collections = std.coalesce({
input: [
_this.then(_this => _this.results),
[],
],
}).result;
const sourceNamespace = std.coalesce({
input: [
sourceNamespaceConfig,
collections.length > 0 ? collections[collections.length - 1].sourceNamespace : null,
],
}).result;
export const collectionStates = .map(c => ({
sourceNamespace: c.sourceNamespace,
targetNamespace: c.targetNamespace,
effectiveTargetNamespace: c.effectiveTargetNamespace,
state: c.state,
indexStatus: c.indexStatus,
documents: `${c.restoredDocuments} / ${c.totalDocuments}`,
}));
const thisGetCloudBackupCollectionRestoreJobCollection = mongodbatlas.getCloudBackupCollectionRestoreJobCollection({
projectId: projectId,
clusterName: clusterName,
jobId: jobId,
sourceNamespace: sourceNamespace,
});
export const collectionState = thisGetCloudBackupCollectionRestoreJobCollection.then(thisGetCloudBackupCollectionRestoreJobCollection => thisGetCloudBackupCollectionRestoreJobCollection.state);
import pulumi
import pulumi_mongodbatlas as mongodbatlas
import pulumi_std as std
# Per-collection read-back for the resolved collection restore job.
this = mongodbatlas.get_cloud_backup_collection_restore_job_collections(project_id=project_id,
cluster_name=cluster_name,
job_id=job_id)
collections = std.coalesce(input=[
this.results,
[],
])["result"]
source_namespace = std.coalesce(input=[
source_namespace_config,
collections[len(collections) - 1]["sourceNamespace"] if len(collections) > 0 else None,
])["result"]
pulumi.export("collectionStates", [{
"sourceNamespace": c["sourceNamespace"],
"targetNamespace": c["targetNamespace"],
"effectiveTargetNamespace": c["effectiveTargetNamespace"],
"state": c["state"],
"indexStatus": c["indexStatus"],
"documents": f"{c['restoredDocuments']} / {c['totalDocuments']}",
} for c in collections])
this_get_cloud_backup_collection_restore_job_collection = mongodbatlas.get_cloud_backup_collection_restore_job_collection(project_id=project_id,
cluster_name=cluster_name,
job_id=job_id,
source_namespace=source_namespace)
pulumi.export("collectionState", this_get_cloud_backup_collection_restore_job_collection.state)
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
// Per-collection read-back for the resolved collection restore job.
var @this = Mongodbatlas.GetCloudBackupCollectionRestoreJobCollections.Invoke(new()
{
ProjectId = projectId,
ClusterName = clusterName,
JobId = jobId,
});
var collections = Std.Coalesce.Invoke(new()
{
Input = new[]
{
@this.Apply(@this => @this.Apply(getCloudBackupCollectionRestoreJobCollectionsResult => getCloudBackupCollectionRestoreJobCollectionsResult.Results)),
new[] {},
},
}).Result;
var sourceNamespace = Std.Coalesce.Invoke(new()
{
Input = new[]
{
sourceNamespaceConfig,
collections.Length > 0 ? collections[collections.Length - 1].SourceNamespace : null,
},
}).Result;
var thisGetCloudBackupCollectionRestoreJobCollection = Mongodbatlas.GetCloudBackupCollectionRestoreJobCollection.Invoke(new()
{
ProjectId = projectId,
ClusterName = clusterName,
JobId = jobId,
SourceNamespace = sourceNamespace,
});
return new Dictionary<string, object?>
{
["collectionStates"] = .Select(c =>
{
return
{
{ "sourceNamespace", c.SourceNamespace },
{ "targetNamespace", c.TargetNamespace },
{ "effectiveTargetNamespace", c.EffectiveTargetNamespace },
{ "state", c.State },
{ "indexStatus", c.IndexStatus },
{ "documents", $"{c.RestoredDocuments} / {c.TotalDocuments}" },
};
}).ToList(),
["collectionState"] = thisGetCloudBackupCollectionRestoreJobCollection.Apply(getCloudBackupCollectionRestoreJobCollectionResult => getCloudBackupCollectionRestoreJobCollectionResult.State),
};
});
Example coming soon!
Example coming soon!
pulumi {
required_providers {
mongodbatlas = {
source = "pulumi/mongodbatlas"
}
}
}
data "mongodbatlas_getcloudbackupcollectionrestorejobcollections" "this" {
project_id = projectId
cluster_name = clusterName
job_id = jobId
}
data "std_coalesce" "invoke_1" {
input = [data.mongodbatlas_getcloudbackupcollectionrestorejobcollections.this.results, []]
}
data "std_coalesce" "invoke_2" {
input = [sourceNamespaceConfig, length(local.collections) > 0 ? local.collections[length(local.collections) - 1].source_namespace : null]
}
data "mongodbatlas_getcloudbackupcollectionrestorejobcollection" "thisGetCloudBackupCollectionRestoreJobCollection" {
project_id = projectId
cluster_name = clusterName
job_id = jobId
source_namespace = local.sourceNamespace
}
# Per-collection read-back for the resolved collection restore job.
locals {
collections = data.std_coalesce.invoke_1.result
}
locals {
sourceNamespace = data.std_coalesce.invoke_2.result
}
output "collectionStates" {
value = [for c in local.collections : {
"sourceNamespace" = c.sourceNamespace
"targetNamespace" = c.targetNamespace
"effectiveTargetNamespace" = c.effectiveTargetNamespace
"state" = c.state
"indexStatus" = c.indexStatus
"documents" ="${c.restoredDocuments} / ${c.totalDocuments}"
} ]
}
output "collectionState" {
value = data.mongodbatlas_getcloudbackupcollectionrestorejobcollection.thisGetCloudBackupCollectionRestoreJobCollection.state
}
Further Examples
- Restore job inspection
- Snapshot restore
- Point-in-time restore
- Snapshot discovery
Using getCloudBackupCollectionRestoreJobCollection
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCloudBackupCollectionRestoreJobCollection(args: GetCloudBackupCollectionRestoreJobCollectionArgs, opts?: InvokeOptions): Promise<GetCloudBackupCollectionRestoreJobCollectionResult>
function getCloudBackupCollectionRestoreJobCollectionOutput(args: GetCloudBackupCollectionRestoreJobCollectionOutputArgs, opts?: InvokeOutputOptions): Output<GetCloudBackupCollectionRestoreJobCollectionResult>def get_cloud_backup_collection_restore_job_collection(cluster_name: Optional[str] = None,
job_id: Optional[str] = None,
project_id: Optional[str] = None,
source_namespace: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCloudBackupCollectionRestoreJobCollectionResult
def get_cloud_backup_collection_restore_job_collection_output(cluster_name: pulumi.Input[Optional[str]] = None,
job_id: pulumi.Input[Optional[str]] = None,
project_id: pulumi.Input[Optional[str]] = None,
source_namespace: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetCloudBackupCollectionRestoreJobCollectionResult]func LookupCloudBackupCollectionRestoreJobCollection(ctx *Context, args *LookupCloudBackupCollectionRestoreJobCollectionArgs, opts ...InvokeOption) (*LookupCloudBackupCollectionRestoreJobCollectionResult, error)
func LookupCloudBackupCollectionRestoreJobCollectionOutput(ctx *Context, args *LookupCloudBackupCollectionRestoreJobCollectionOutputArgs, opts ...InvokeOption) LookupCloudBackupCollectionRestoreJobCollectionResultOutput> Note: This function is named LookupCloudBackupCollectionRestoreJobCollection in the Go SDK.
public static class GetCloudBackupCollectionRestoreJobCollection
{
public static Task<GetCloudBackupCollectionRestoreJobCollectionResult> InvokeAsync(GetCloudBackupCollectionRestoreJobCollectionArgs args, InvokeOptions? opts = null)
public static Output<GetCloudBackupCollectionRestoreJobCollectionResult> Invoke(GetCloudBackupCollectionRestoreJobCollectionInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetCloudBackupCollectionRestoreJobCollectionResult> Invoke(GetCloudBackupCollectionRestoreJobCollectionInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetCloudBackupCollectionRestoreJobCollectionResult> getCloudBackupCollectionRestoreJobCollection(GetCloudBackupCollectionRestoreJobCollectionArgs args, InvokeOptions options)
public static Output<GetCloudBackupCollectionRestoreJobCollectionResult> getCloudBackupCollectionRestoreJobCollection(GetCloudBackupCollectionRestoreJobCollectionArgs args, InvokeOptions options)
public static Output<GetCloudBackupCollectionRestoreJobCollectionResult> getCloudBackupCollectionRestoreJobCollection(GetCloudBackupCollectionRestoreJobCollectionArgs args, InvokeOutputOptions options)
fn::invoke:
function: mongodbatlas:index/getCloudBackupCollectionRestoreJobCollection:getCloudBackupCollectionRestoreJobCollection
arguments:
# arguments dictionarydata "mongodbatlas_get_cloud_backup_collection_restore_job_collection" "name" {
# arguments
}The following arguments are supported:
- Cluster
Name string - Human-readable label that identifies the cluster with the collection restore job you want to return.
- Job
Id string - Unique 24-hexadecimal digit string that identifies the collection restore job.
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - Source
Namespace string - Source namespace that identifies the collection to return (e.g.
db.collection).
- Cluster
Name string - Human-readable label that identifies the cluster with the collection restore job you want to return.
- Job
Id string - Unique 24-hexadecimal digit string that identifies the collection restore job.
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - Source
Namespace string - Source namespace that identifies the collection to return (e.g.
db.collection).
- cluster_
name string - Human-readable label that identifies the cluster with the collection restore job you want to return.
- job_
id string - Unique 24-hexadecimal digit string that identifies the collection restore job.
- project_
id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - source_
namespace string - Source namespace that identifies the collection to return (e.g.
db.collection).
- cluster
Name String - Human-readable label that identifies the cluster with the collection restore job you want to return.
- job
Id String - Unique 24-hexadecimal digit string that identifies the collection restore job.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - source
Namespace String - Source namespace that identifies the collection to return (e.g.
db.collection).
- cluster
Name string - Human-readable label that identifies the cluster with the collection restore job you want to return.
- job
Id string - Unique 24-hexadecimal digit string that identifies the collection restore job.
- project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - source
Namespace string - Source namespace that identifies the collection to return (e.g.
db.collection).
- cluster_
name str - Human-readable label that identifies the cluster with the collection restore job you want to return.
- job_
id str - Unique 24-hexadecimal digit string that identifies the collection restore job.
- project_
id str - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - source_
namespace str - Source namespace that identifies the collection to return (e.g.
db.collection).
- cluster
Name String - Human-readable label that identifies the cluster with the collection restore job you want to return.
- job
Id String - Unique 24-hexadecimal digit string that identifies the collection restore job.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - source
Namespace String - Source namespace that identifies the collection to return (e.g.
db.collection).
getCloudBackupCollectionRestoreJobCollection Result
The following output properties are available:
- Cluster
Name string - Human-readable label that identifies the cluster with the collection restore job you want to return.
- Effective
Target stringNamespace - Actual target namespace after restore (e.g. after conflict rename).
- Index
Status GetCloud Backup Collection Restore Job Collection Index Status - Index build status for a collection within a restore job.
- Job
Id string - Unique 24-hexadecimal digit string that identifies the collection restore job.
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - Restored
Documents int - Number of documents restored so far.
- Source
Namespace string - Source namespace that identifies the collection to return (e.g.
db.collection). - State string
- Current state of this collection within the restore job.
- Target
Namespace string - Requested target namespace for the restored collection.
- Total
Documents int - Total document count for this collection.
- Cluster
Name string - Human-readable label that identifies the cluster with the collection restore job you want to return.
- Effective
Target stringNamespace - Actual target namespace after restore (e.g. after conflict rename).
- Index
Status GetCloud Backup Collection Restore Job Collection Index Status - Index build status for a collection within a restore job.
- Job
Id string - Unique 24-hexadecimal digit string that identifies the collection restore job.
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - Restored
Documents int - Number of documents restored so far.
- Source
Namespace string - Source namespace that identifies the collection to return (e.g.
db.collection). - State string
- Current state of this collection within the restore job.
- Target
Namespace string - Requested target namespace for the restored collection.
- Total
Documents int - Total document count for this collection.
- cluster_
name string - Human-readable label that identifies the cluster with the collection restore job you want to return.
- effective_
target_ stringnamespace - Actual target namespace after restore (e.g. after conflict rename).
- index_
status object - Index build status for a collection within a restore job.
- job_
id string - Unique 24-hexadecimal digit string that identifies the collection restore job.
- project_
id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - restored_
documents number - Number of documents restored so far.
- source_
namespace string - Source namespace that identifies the collection to return (e.g.
db.collection). - state string
- Current state of this collection within the restore job.
- target_
namespace string - Requested target namespace for the restored collection.
- total_
documents number - Total document count for this collection.
- cluster
Name String - Human-readable label that identifies the cluster with the collection restore job you want to return.
- effective
Target StringNamespace - Actual target namespace after restore (e.g. after conflict rename).
- index
Status GetCloud Backup Collection Restore Job Collection Index Status - Index build status for a collection within a restore job.
- job
Id String - Unique 24-hexadecimal digit string that identifies the collection restore job.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - restored
Documents Integer - Number of documents restored so far.
- source
Namespace String - Source namespace that identifies the collection to return (e.g.
db.collection). - state String
- Current state of this collection within the restore job.
- target
Namespace String - Requested target namespace for the restored collection.
- total
Documents Integer - Total document count for this collection.
- cluster
Name string - Human-readable label that identifies the cluster with the collection restore job you want to return.
- effective
Target stringNamespace - Actual target namespace after restore (e.g. after conflict rename).
- index
Status GetCloud Backup Collection Restore Job Collection Index Status - Index build status for a collection within a restore job.
- job
Id string - Unique 24-hexadecimal digit string that identifies the collection restore job.
- project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - restored
Documents number - Number of documents restored so far.
- source
Namespace string - Source namespace that identifies the collection to return (e.g.
db.collection). - state string
- Current state of this collection within the restore job.
- target
Namespace string - Requested target namespace for the restored collection.
- total
Documents number - Total document count for this collection.
- cluster_
name str - Human-readable label that identifies the cluster with the collection restore job you want to return.
- effective_
target_ strnamespace - Actual target namespace after restore (e.g. after conflict rename).
- index_
status GetCloud Backup Collection Restore Job Collection Index Status - Index build status for a collection within a restore job.
- job_
id str - Unique 24-hexadecimal digit string that identifies the collection restore job.
- project_
id str - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - restored_
documents int - Number of documents restored so far.
- source_
namespace str - Source namespace that identifies the collection to return (e.g.
db.collection). - state str
- Current state of this collection within the restore job.
- target_
namespace str - Requested target namespace for the restored collection.
- total_
documents int - Total document count for this collection.
- cluster
Name String - Human-readable label that identifies the cluster with the collection restore job you want to return.
- effective
Target StringNamespace - Actual target namespace after restore (e.g. after conflict rename).
- index
Status Property Map - Index build status for a collection within a restore job.
- job
Id String - Unique 24-hexadecimal digit string that identifies the collection restore job.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - restored
Documents Number - Number of documents restored so far.
- source
Namespace String - Source namespace that identifies the collection to return (e.g.
db.collection). - state String
- Current state of this collection within the restore job.
- target
Namespace String - Requested target namespace for the restored collection.
- total
Documents Number - Total document count for this collection.
Supporting Types
GetCloudBackupCollectionRestoreJobCollectionIndexStatus
- Error
Message string - Error message if index build failed.
- Failed
Indexes List<string> - List of index specifications that failed to build (up to 64 items).
- State string
- Index build state indicating the status of index creation during or after a restore operation.
- Error
Message string - Error message if index build failed.
- Failed
Indexes []string - List of index specifications that failed to build (up to 64 items).
- State string
- Index build state indicating the status of index creation during or after a restore operation.
- error_
message string - Error message if index build failed.
- failed_
indexes list(string) - List of index specifications that failed to build (up to 64 items).
- state string
- Index build state indicating the status of index creation during or after a restore operation.
- error
Message String - Error message if index build failed.
- failed
Indexes List<String> - List of index specifications that failed to build (up to 64 items).
- state String
- Index build state indicating the status of index creation during or after a restore operation.
- error
Message string - Error message if index build failed.
- failed
Indexes string[] - List of index specifications that failed to build (up to 64 items).
- state string
- Index build state indicating the status of index creation during or after a restore operation.
- error_
message str - Error message if index build failed.
- failed_
indexes Sequence[str] - List of index specifications that failed to build (up to 64 items).
- state str
- Index build state indicating the status of index creation during or after a restore operation.
- error
Message String - Error message if index build failed.
- failed
Indexes List<String> - List of index specifications that failed to build (up to 64 items).
- state String
- Index build state indicating the status of index creation during or after a restore operation.
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlasTerraform Provider.
published on Friday, Aug 28, 2026 by Pulumi