1. Packages
  2. Volcengine
  3. API Docs
  4. ebs
  5. Snapshots
Volcengine v0.0.28 published on Thursday, Apr 24, 2025 by Volcengine

volcengine.ebs.Snapshots

Explore with Pulumi AI

Volcengine v0.0.28 published on Thursday, Apr 24, 2025 by Volcengine

Use this data source to query detailed information of ebs snapshots

Example Usage

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

const fooZones = volcengine.ecs.Zones({});
const fooVolume = new volcengine.ebs.Volume("fooVolume", {
    volumeName: "acc-test-volume",
    volumeType: "ESSD_PL0",
    description: "acc-test",
    kind: "data",
    size: 500,
    zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
    volumeChargeType: "PostPaid",
    projectName: "default",
});
const fooSnapshot: volcengine.ebs.Snapshot[] = [];
for (const range = {value: 0}; range.value < 2; range.value++) {
    fooSnapshot.push(new volcengine.ebs.Snapshot(`fooSnapshot-${range.value}`, {
        volumeId: fooVolume.id,
        snapshotName: "acc-test-snapshot",
        description: "acc-test",
        retentionDays: 3,
        projectName: "default",
        tags: [{
            key: "k1",
            value: "v1",
        }],
    }));
}
const fooSnapshots = volcengine.ebs.SnapshotsOutput({
    ids: fooSnapshot.map(__item => __item.id),
});
Copy
import pulumi
import pulumi_volcengine as volcengine

foo_zones = volcengine.ecs.zones()
foo_volume = volcengine.ebs.Volume("fooVolume",
    volume_name="acc-test-volume",
    volume_type="ESSD_PL0",
    description="acc-test",
    kind="data",
    size=500,
    zone_id=foo_zones.zones[0].id,
    volume_charge_type="PostPaid",
    project_name="default")
foo_snapshot = []
for range in [{"value": i} for i in range(0, 2)]:
    foo_snapshot.append(volcengine.ebs.Snapshot(f"fooSnapshot-{range['value']}",
        volume_id=foo_volume.id,
        snapshot_name="acc-test-snapshot",
        description="acc-test",
        retention_days=3,
        project_name="default",
        tags=[volcengine.ebs.SnapshotTagArgs(
            key="k1",
            value="v1",
        )]))
foo_snapshots = volcengine.ebs.snapshots_output(ids=[__item.id for __item in foo_snapshot])
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ebs"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooZones, err := ecs.Zones(ctx, nil, nil);
if err != nil {
return err
}
fooVolume, err := ebs.NewVolume(ctx, "fooVolume", &ebs.VolumeArgs{
VolumeName: pulumi.String("acc-test-volume"),
VolumeType: pulumi.String("ESSD_PL0"),
Description: pulumi.String("acc-test"),
Kind: pulumi.String("data"),
Size: pulumi.Int(500),
ZoneId: pulumi.String(fooZones.Zones[0].Id),
VolumeChargeType: pulumi.String("PostPaid"),
ProjectName: pulumi.String("default"),
})
if err != nil {
return err
}
var fooSnapshot []*ebs.Snapshot
for index := 0; index < 2; index++ {
    key0 := index
    _ := index
__res, err := ebs.NewSnapshot(ctx, fmt.Sprintf("fooSnapshot-%v", key0), &ebs.SnapshotArgs{
VolumeId: fooVolume.ID(),
SnapshotName: pulumi.String("acc-test-snapshot"),
Description: pulumi.String("acc-test"),
RetentionDays: pulumi.Int(3),
ProjectName: pulumi.String("default"),
Tags: ebs.SnapshotTagArray{
&ebs.SnapshotTagArgs{
Key: pulumi.String("k1"),
Value: pulumi.String("v1"),
},
},
})
if err != nil {
return err
}
fooSnapshot = append(fooSnapshot, __res)
}
_ = ebs.SnapshotsOutput(ctx, ebs.SnapshotsOutputArgs{
Ids: %!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ #-functions-volcengine:ebs-snapshots:Snapshots.pp:28,9-26),
}, nil);
return nil
})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var fooZones = Volcengine.Ecs.Zones.Invoke();

    var fooVolume = new Volcengine.Ebs.Volume("fooVolume", new()
    {
        VolumeName = "acc-test-volume",
        VolumeType = "ESSD_PL0",
        Description = "acc-test",
        Kind = "data",
        Size = 500,
        ZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
        VolumeChargeType = "PostPaid",
        ProjectName = "default",
    });

    var fooSnapshot = new List<Volcengine.Ebs.Snapshot>();
    for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
    {
        var range = new { Value = rangeIndex };
        fooSnapshot.Add(new Volcengine.Ebs.Snapshot($"fooSnapshot-{range.Value}", new()
        {
            VolumeId = fooVolume.Id,
            SnapshotName = "acc-test-snapshot",
            Description = "acc-test",
            RetentionDays = 3,
            ProjectName = "default",
            Tags = new[]
            {
                new Volcengine.Ebs.Inputs.SnapshotTagArgs
                {
                    Key = "k1",
                    Value = "v1",
                },
            },
        }));
    }
    var fooSnapshots = Volcengine.Ebs.Snapshots.Invoke(new()
    {
        Ids = fooSnapshot.Select(__item => __item.Id).ToList(),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.ecs.EcsFunctions;
import com.pulumi.volcengine.ecs.inputs.ZonesArgs;
import com.pulumi.volcengine.ebs.Volume;
import com.pulumi.volcengine.ebs.VolumeArgs;
import com.pulumi.volcengine.ebs.Snapshot;
import com.pulumi.volcengine.ebs.SnapshotArgs;
import com.pulumi.volcengine.ebs.inputs.SnapshotTagArgs;
import com.pulumi.volcengine.ebs.EbsFunctions;
import com.pulumi.volcengine.ebs.inputs.SnapshotsArgs;
import com.pulumi.codegen.internal.KeyedValue;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var fooZones = EcsFunctions.Zones();

        var fooVolume = new Volume("fooVolume", VolumeArgs.builder()        
            .volumeName("acc-test-volume")
            .volumeType("ESSD_PL0")
            .description("acc-test")
            .kind("data")
            .size(500)
            .zoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
            .volumeChargeType("PostPaid")
            .projectName("default")
            .build());

        for (var i = 0; i < 2; i++) {
            new Snapshot("fooSnapshot-" + i, SnapshotArgs.builder()            
                .volumeId(fooVolume.id())
                .snapshotName("acc-test-snapshot")
                .description("acc-test")
                .retentionDays(3)
                .projectName("default")
                .tags(SnapshotTagArgs.builder()
                    .key("k1")
                    .value("v1")
                    .build())
                .build());

        
}
        final var fooSnapshots = EbsFunctions.Snapshots(SnapshotsArgs.builder()
            .ids(fooSnapshot.stream().map(element -> element.id()).collect(toList()))
            .build());

    }
}
Copy
Coming soon!

Using Snapshots

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 snapshots(args: SnapshotsArgs, opts?: InvokeOptions): Promise<SnapshotsResult>
function snapshotsOutput(args: SnapshotsOutputArgs, opts?: InvokeOptions): Output<SnapshotsResult>
Copy
def snapshots(ids: Optional[Sequence[str]] = None,
              name_regex: Optional[str] = None,
              output_file: Optional[str] = None,
              project_name: Optional[str] = None,
              snapshot_statuses: Optional[Sequence[str]] = None,
              tags: Optional[Sequence[SnapshotsTag]] = None,
              zone_id: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> SnapshotsResult
def snapshots_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
              name_regex: Optional[pulumi.Input[str]] = None,
              output_file: Optional[pulumi.Input[str]] = None,
              project_name: Optional[pulumi.Input[str]] = None,
              snapshot_statuses: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
              tags: Optional[pulumi.Input[Sequence[pulumi.Input[SnapshotsTagArgs]]]] = None,
              zone_id: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[SnapshotsResult]
Copy
func Snapshots(ctx *Context, args *SnapshotsArgs, opts ...InvokeOption) (*SnapshotsResult, error)
func SnapshotsOutput(ctx *Context, args *SnapshotsOutputArgs, opts ...InvokeOption) SnapshotsResultOutput
Copy
public static class Snapshots 
{
    public static Task<SnapshotsResult> InvokeAsync(SnapshotsArgs args, InvokeOptions? opts = null)
    public static Output<SnapshotsResult> Invoke(SnapshotsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<SnapshotsResult> snapshots(SnapshotsArgs args, InvokeOptions options)
public static Output<SnapshotsResult> snapshots(SnapshotsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: volcengine:ebs:Snapshots
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids List<string>
A list of snapshot IDs.
NameRegex string
A Name Regex of Resource.
OutputFile string
File name where to save data source results.
ProjectName string
The project name of snapshot.
SnapshotStatuses List<string>
A list of snapshot status.
Tags List<SnapshotsTag>
Tags.
ZoneId string
The zone id of snapshot.
Ids []string
A list of snapshot IDs.
NameRegex string
A Name Regex of Resource.
OutputFile string
File name where to save data source results.
ProjectName string
The project name of snapshot.
SnapshotStatuses []string
A list of snapshot status.
Tags []SnapshotsTag
Tags.
ZoneId string
The zone id of snapshot.
ids List<String>
A list of snapshot IDs.
nameRegex String
A Name Regex of Resource.
outputFile String
File name where to save data source results.
projectName String
The project name of snapshot.
snapshotStatuses List<String>
A list of snapshot status.
tags List<SnapshotsTag>
Tags.
zoneId String
The zone id of snapshot.
ids string[]
A list of snapshot IDs.
nameRegex string
A Name Regex of Resource.
outputFile string
File name where to save data source results.
projectName string
The project name of snapshot.
snapshotStatuses string[]
A list of snapshot status.
tags SnapshotsTag[]
Tags.
zoneId string
The zone id of snapshot.
ids Sequence[str]
A list of snapshot IDs.
name_regex str
A Name Regex of Resource.
output_file str
File name where to save data source results.
project_name str
The project name of snapshot.
snapshot_statuses Sequence[str]
A list of snapshot status.
tags Sequence[SnapshotsTag]
Tags.
zone_id str
The zone id of snapshot.
ids List<String>
A list of snapshot IDs.
nameRegex String
A Name Regex of Resource.
outputFile String
File name where to save data source results.
projectName String
The project name of snapshot.
snapshotStatuses List<String>
A list of snapshot status.
tags List<Property Map>
Tags.
zoneId String
The zone id of snapshot.

Snapshots Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Snapshots List<SnapshotsSnapshot>
The collection of query.
TotalCount int
The total count of query.
Ids List<string>
NameRegex string
OutputFile string
ProjectName string
The project name of the snapshot.
SnapshotStatuses List<string>
Tags List<SnapshotsTag>
Tags.
ZoneId string
The zone id of the snapshot.
Id string
The provider-assigned unique ID for this managed resource.
Snapshots []SnapshotsSnapshot
The collection of query.
TotalCount int
The total count of query.
Ids []string
NameRegex string
OutputFile string
ProjectName string
The project name of the snapshot.
SnapshotStatuses []string
Tags []SnapshotsTag
Tags.
ZoneId string
The zone id of the snapshot.
id String
The provider-assigned unique ID for this managed resource.
snapshots List<SnapshotsSnapshot>
The collection of query.
totalCount Integer
The total count of query.
ids List<String>
nameRegex String
outputFile String
projectName String
The project name of the snapshot.
snapshotStatuses List<String>
tags List<SnapshotsTag>
Tags.
zoneId String
The zone id of the snapshot.
id string
The provider-assigned unique ID for this managed resource.
snapshots SnapshotsSnapshot[]
The collection of query.
totalCount number
The total count of query.
ids string[]
nameRegex string
outputFile string
projectName string
The project name of the snapshot.
snapshotStatuses string[]
tags SnapshotsTag[]
Tags.
zoneId string
The zone id of the snapshot.
id str
The provider-assigned unique ID for this managed resource.
snapshots Sequence[SnapshotsSnapshot]
The collection of query.
total_count int
The total count of query.
ids Sequence[str]
name_regex str
output_file str
project_name str
The project name of the snapshot.
snapshot_statuses Sequence[str]
tags Sequence[SnapshotsTag]
Tags.
zone_id str
The zone id of the snapshot.
id String
The provider-assigned unique ID for this managed resource.
snapshots List<Property Map>
The collection of query.
totalCount Number
The total count of query.
ids List<String>
nameRegex String
outputFile String
projectName String
The project name of the snapshot.
snapshotStatuses List<String>
tags List<Property Map>
Tags.
zoneId String
The zone id of the snapshot.

Supporting Types

SnapshotsSnapshot

CreationTime This property is required. string
The creation time of the snapshot.
Description This property is required. string
The description of the snapshot.
Id This property is required. string
The id of the snapshot.
ProjectName This property is required. string
The project name of snapshot.
RetentionDays This property is required. int
The retention days of the snapshot.
SnapshotId This property is required. string
The id of the snapshot.
SnapshotName This property is required. string
The name of the snapshot.
SnapshotType This property is required. string
The type of the snapshot.
Status This property is required. string
The status of the snapshot.
Tags This property is required. List<SnapshotsSnapshotTag>
Tags.
VolumeId This property is required. string
The volume id of the snapshot.
VolumeKind This property is required. string
The volume kind of the snapshot.
VolumeName This property is required. string
The volume name of the snapshot.
VolumeSize This property is required. int
The volume size of the snapshot.
VolumeStatus This property is required. string
The volume status of the snapshot.
VolumeType This property is required. string
The volume type of the snapshot.
ZoneId This property is required. string
The zone id of snapshot.
CreationTime This property is required. string
The creation time of the snapshot.
Description This property is required. string
The description of the snapshot.
Id This property is required. string
The id of the snapshot.
ProjectName This property is required. string
The project name of snapshot.
RetentionDays This property is required. int
The retention days of the snapshot.
SnapshotId This property is required. string
The id of the snapshot.
SnapshotName This property is required. string
The name of the snapshot.
SnapshotType This property is required. string
The type of the snapshot.
Status This property is required. string
The status of the snapshot.
Tags This property is required. []SnapshotsSnapshotTag
Tags.
VolumeId This property is required. string
The volume id of the snapshot.
VolumeKind This property is required. string
The volume kind of the snapshot.
VolumeName This property is required. string
The volume name of the snapshot.
VolumeSize This property is required. int
The volume size of the snapshot.
VolumeStatus This property is required. string
The volume status of the snapshot.
VolumeType This property is required. string
The volume type of the snapshot.
ZoneId This property is required. string
The zone id of snapshot.
creationTime This property is required. String
The creation time of the snapshot.
description This property is required. String
The description of the snapshot.
id This property is required. String
The id of the snapshot.
projectName This property is required. String
The project name of snapshot.
retentionDays This property is required. Integer
The retention days of the snapshot.
snapshotId This property is required. String
The id of the snapshot.
snapshotName This property is required. String
The name of the snapshot.
snapshotType This property is required. String
The type of the snapshot.
status This property is required. String
The status of the snapshot.
tags This property is required. List<SnapshotsSnapshotTag>
Tags.
volumeId This property is required. String
The volume id of the snapshot.
volumeKind This property is required. String
The volume kind of the snapshot.
volumeName This property is required. String
The volume name of the snapshot.
volumeSize This property is required. Integer
The volume size of the snapshot.
volumeStatus This property is required. String
The volume status of the snapshot.
volumeType This property is required. String
The volume type of the snapshot.
zoneId This property is required. String
The zone id of snapshot.
creationTime This property is required. string
The creation time of the snapshot.
description This property is required. string
The description of the snapshot.
id This property is required. string
The id of the snapshot.
projectName This property is required. string
The project name of snapshot.
retentionDays This property is required. number
The retention days of the snapshot.
snapshotId This property is required. string
The id of the snapshot.
snapshotName This property is required. string
The name of the snapshot.
snapshotType This property is required. string
The type of the snapshot.
status This property is required. string
The status of the snapshot.
tags This property is required. SnapshotsSnapshotTag[]
Tags.
volumeId This property is required. string
The volume id of the snapshot.
volumeKind This property is required. string
The volume kind of the snapshot.
volumeName This property is required. string
The volume name of the snapshot.
volumeSize This property is required. number
The volume size of the snapshot.
volumeStatus This property is required. string
The volume status of the snapshot.
volumeType This property is required. string
The volume type of the snapshot.
zoneId This property is required. string
The zone id of snapshot.
creation_time This property is required. str
The creation time of the snapshot.
description This property is required. str
The description of the snapshot.
id This property is required. str
The id of the snapshot.
project_name This property is required. str
The project name of snapshot.
retention_days This property is required. int
The retention days of the snapshot.
snapshot_id This property is required. str
The id of the snapshot.
snapshot_name This property is required. str
The name of the snapshot.
snapshot_type This property is required. str
The type of the snapshot.
status This property is required. str
The status of the snapshot.
tags This property is required. Sequence[SnapshotsSnapshotTag]
Tags.
volume_id This property is required. str
The volume id of the snapshot.
volume_kind This property is required. str
The volume kind of the snapshot.
volume_name This property is required. str
The volume name of the snapshot.
volume_size This property is required. int
The volume size of the snapshot.
volume_status This property is required. str
The volume status of the snapshot.
volume_type This property is required. str
The volume type of the snapshot.
zone_id This property is required. str
The zone id of snapshot.
creationTime This property is required. String
The creation time of the snapshot.
description This property is required. String
The description of the snapshot.
id This property is required. String
The id of the snapshot.
projectName This property is required. String
The project name of snapshot.
retentionDays This property is required. Number
The retention days of the snapshot.
snapshotId This property is required. String
The id of the snapshot.
snapshotName This property is required. String
The name of the snapshot.
snapshotType This property is required. String
The type of the snapshot.
status This property is required. String
The status of the snapshot.
tags This property is required. List<Property Map>
Tags.
volumeId This property is required. String
The volume id of the snapshot.
volumeKind This property is required. String
The volume kind of the snapshot.
volumeName This property is required. String
The volume name of the snapshot.
volumeSize This property is required. Number
The volume size of the snapshot.
volumeStatus This property is required. String
The volume status of the snapshot.
volumeType This property is required. String
The volume type of the snapshot.
zoneId This property is required. String
The zone id of snapshot.

SnapshotsSnapshotTag

Key This property is required. string
The Key of Tags.
Value This property is required. string
The Value of Tags.
Key This property is required. string
The Key of Tags.
Value This property is required. string
The Value of Tags.
key This property is required. String
The Key of Tags.
value This property is required. String
The Value of Tags.
key This property is required. string
The Key of Tags.
value This property is required. string
The Value of Tags.
key This property is required. str
The Key of Tags.
value This property is required. str
The Value of Tags.
key This property is required. String
The Key of Tags.
value This property is required. String
The Value of Tags.

SnapshotsTag

Key This property is required. string
The Key of Tags.
Value This property is required. string
The Value of Tags.
Key This property is required. string
The Key of Tags.
Value This property is required. string
The Value of Tags.
key This property is required. String
The Key of Tags.
value This property is required. String
The Value of Tags.
key This property is required. string
The Key of Tags.
value This property is required. string
The Value of Tags.
key This property is required. str
The Key of Tags.
value This property is required. str
The Value of Tags.
key This property is required. String
The Key of Tags.
value This property is required. String
The Value of Tags.

Package Details

Repository
volcengine volcengine/pulumi-volcengine
License
Apache-2.0
Notes
This Pulumi package is based on the volcengine Terraform Provider.
Volcengine v0.0.28 published on Thursday, Apr 24, 2025 by Volcengine