1. Packages
  2. Mongodbatlas Provider
  3. API Docs
  4. getFlexSnapshots
MongoDB Atlas v3.30.0 published on Friday, Mar 21, 2025 by Pulumi

mongodbatlas.getFlexSnapshots

Explore with Pulumi AI

# Data Source: mongodbatlas.getFlexSnapshots

mongodbatlas.getFlexSnapshots returns all snapshots of a flex cluster.

Example Usage

S

import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const snapshot = mongodbatlas.getFlexSnapshot({
    projectId: projectId,
    name: example_cluster.name,
    snapshotId: snapshotId,
});
const snapshots = mongodbatlas.getFlexSnapshots({
    projectId: projectId,
    name: example_cluster.name,
});
export const mongodbatlasFlexSnapshot = snapshot.then(snapshot => snapshot.name);
export const mongodbatlasFlexSnapshots = snapshots.then(snapshots => .map(snapshot => (snapshot.snapshotId)));
Copy
import pulumi
import pulumi_mongodbatlas as mongodbatlas

snapshot = mongodbatlas.get_flex_snapshot(project_id=project_id,
    name=example_cluster["name"],
    snapshot_id=snapshot_id)
snapshots = mongodbatlas.get_flex_snapshots(project_id=project_id,
    name=example_cluster["name"])
pulumi.export("mongodbatlasFlexSnapshot", snapshot.name)
pulumi.export("mongodbatlasFlexSnapshots", [snapshot.snapshot_id for snapshot in snapshots.results])
Copy
Coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var snapshot = Mongodbatlas.GetFlexSnapshot.Invoke(new()
    {
        ProjectId = projectId,
        Name = example_cluster.Name,
        SnapshotId = snapshotId,
    });

    var snapshots = Mongodbatlas.GetFlexSnapshots.Invoke(new()
    {
        ProjectId = projectId,
        Name = example_cluster.Name,
    });

    return new Dictionary<string, object?>
    {
        ["mongodbatlasFlexSnapshot"] = snapshot.Apply(getFlexSnapshotResult => getFlexSnapshotResult.Name),
        ["mongodbatlasFlexSnapshots"] = .Select(snapshot => 
        {
            return snapshot.Apply(getFlexSnapshotResult => getFlexSnapshotResult.SnapshotId);
        }).ToList(),
    };
});
Copy
Coming soon!
Coming soon!

Using getFlexSnapshots

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 getFlexSnapshots(args: GetFlexSnapshotsArgs, opts?: InvokeOptions): Promise<GetFlexSnapshotsResult>
function getFlexSnapshotsOutput(args: GetFlexSnapshotsOutputArgs, opts?: InvokeOptions): Output<GetFlexSnapshotsResult>
Copy
def get_flex_snapshots(name: Optional[str] = None,
                       project_id: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetFlexSnapshotsResult
def get_flex_snapshots_output(name: Optional[pulumi.Input[str]] = None,
                       project_id: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetFlexSnapshotsResult]
Copy
func LookupFlexSnapshots(ctx *Context, args *LookupFlexSnapshotsArgs, opts ...InvokeOption) (*LookupFlexSnapshotsResult, error)
func LookupFlexSnapshotsOutput(ctx *Context, args *LookupFlexSnapshotsOutputArgs, opts ...InvokeOption) LookupFlexSnapshotsResultOutput
Copy

> Note: This function is named LookupFlexSnapshots in the Go SDK.

public static class GetFlexSnapshots 
{
    public static Task<GetFlexSnapshotsResult> InvokeAsync(GetFlexSnapshotsArgs args, InvokeOptions? opts = null)
    public static Output<GetFlexSnapshotsResult> Invoke(GetFlexSnapshotsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetFlexSnapshotsResult> getFlexSnapshots(GetFlexSnapshotsArgs args, InvokeOptions options)
public static Output<GetFlexSnapshotsResult> getFlexSnapshots(GetFlexSnapshotsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: mongodbatlas:index/getFlexSnapshots:getFlexSnapshots
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
ProjectId This property is required. string
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
Name This property is required. string
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
ProjectId This property is required. string
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
name This property is required. String
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
projectId This property is required. String
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
name This property is required. string
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
projectId This property is required. string
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
name This property is required. str
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
project_id This property is required. str
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
name This property is required. String
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
projectId This property is required. String
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.

getFlexSnapshots Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Name string
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
ProjectId string
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
Results List<GetFlexSnapshotsResult>
Id string
The provider-assigned unique ID for this managed resource.
Name string
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
ProjectId string
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
Results []GetFlexSnapshotsResult
id String
The provider-assigned unique ID for this managed resource.
name String
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
projectId String
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
results List<GetFlexSnapshotsResult>
id string
The provider-assigned unique ID for this managed resource.
name string
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
projectId string
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
results GetFlexSnapshotsResult[]
id str
The provider-assigned unique ID for this managed resource.
name str
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
project_id str
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
results Sequence[GetFlexSnapshotsResult]
id String
The provider-assigned unique ID for this managed resource.
name String
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
projectId String
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
results List<Property Map>

Supporting Types

GetFlexSnapshotsResult

Expiration This property is required. string
Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
FinishTime This property is required. string
Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
MongoDbVersion This property is required. string
MongoDB host version that the snapshot runs.
Name This property is required. string
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
ProjectId This property is required. string
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
ScheduledTime This property is required. string
Date and time when MongoDB Cloud will take the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
SnapshotId This property is required. string
Unique 24-hexadecimal digit string that identifies the snapshot to restore.
StartTime This property is required. string
Date and time when MongoDB Cloud began taking the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
Status This property is required. string
Phase of the restore workflow for this job at the time this resource made this request.
Expiration This property is required. string
Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
FinishTime This property is required. string
Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
MongoDbVersion This property is required. string
MongoDB host version that the snapshot runs.
Name This property is required. string
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
ProjectId This property is required. string
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
ScheduledTime This property is required. string
Date and time when MongoDB Cloud will take the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
SnapshotId This property is required. string
Unique 24-hexadecimal digit string that identifies the snapshot to restore.
StartTime This property is required. string
Date and time when MongoDB Cloud began taking the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
Status This property is required. string
Phase of the restore workflow for this job at the time this resource made this request.
expiration This property is required. String
Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
finishTime This property is required. String
Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
mongoDbVersion This property is required. String
MongoDB host version that the snapshot runs.
name This property is required. String
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
projectId This property is required. String
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
scheduledTime This property is required. String
Date and time when MongoDB Cloud will take the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
snapshotId This property is required. String
Unique 24-hexadecimal digit string that identifies the snapshot to restore.
startTime This property is required. String
Date and time when MongoDB Cloud began taking the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
status This property is required. String
Phase of the restore workflow for this job at the time this resource made this request.
expiration This property is required. string
Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
finishTime This property is required. string
Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
mongoDbVersion This property is required. string
MongoDB host version that the snapshot runs.
name This property is required. string
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
projectId This property is required. string
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
scheduledTime This property is required. string
Date and time when MongoDB Cloud will take the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
snapshotId This property is required. string
Unique 24-hexadecimal digit string that identifies the snapshot to restore.
startTime This property is required. string
Date and time when MongoDB Cloud began taking the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
status This property is required. string
Phase of the restore workflow for this job at the time this resource made this request.
expiration This property is required. str
Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
finish_time This property is required. str
Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
mongo_db_version This property is required. str
MongoDB host version that the snapshot runs.
name This property is required. str
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
project_id This property is required. str
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
scheduled_time This property is required. str
Date and time when MongoDB Cloud will take the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
snapshot_id This property is required. str
Unique 24-hexadecimal digit string that identifies the snapshot to restore.
start_time This property is required. str
Date and time when MongoDB Cloud began taking the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
status This property is required. str
Phase of the restore workflow for this job at the time this resource made this request.
expiration This property is required. String
Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
finishTime This property is required. String
Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
mongoDbVersion This property is required. String
MongoDB host version that the snapshot runs.
name This property is required. String
Human-readable label that identifies the flex cluster whose snapshot you want to restore.
projectId This property is required. String
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
scheduledTime This property is required. String
Date and time when MongoDB Cloud will take the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
snapshotId This property is required. String
Unique 24-hexadecimal digit string that identifies the snapshot to restore.
startTime This property is required. String
Date and time when MongoDB Cloud began taking the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
status This property is required. String
Phase of the restore workflow for this job at the time this resource made this request.

Package Details

Repository
MongoDB Atlas pulumi/pulumi-mongodbatlas
License
Apache-2.0
Notes
This Pulumi package is based on the mongodbatlas Terraform Provider.