Volcengine v0.0.38 published on Friday, Oct 31, 2025 by Volcengine
Volcengine v0.0.38 published on Friday, Oct 31, 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.getZones({});
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.getSnapshotsOutput({
ids: fooSnapshot.map(__item => __item.id),
});
import pulumi
import pulumi_volcengine as volcengine
foo_zones = volcengine.ecs.get_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.get_snapshots_output(ids=[__item.id for __item in foo_snapshot])
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.GetZones(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.GetSnapshotsOutput(ctx, ebs.GetSnapshotsOutputArgs{
Ids: %!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ #-functions-volcengine:ebs-getSnapshots:getSnapshots.pp:28,9-26),
}, nil);
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var fooZones = Volcengine.Ecs.GetZones.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(getZonesResult => getZonesResult.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.GetSnapshots.Invoke(new()
{
Ids = fooSnapshot.Select(__item => __item.Id).ToList(),
});
});
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.GetZonesArgs;
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.GetSnapshotsArgs;
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.getZones();
var fooVolume = new Volume("fooVolume", VolumeArgs.builder()
.volumeName("acc-test-volume")
.volumeType("ESSD_PL0")
.description("acc-test")
.kind("data")
.size(500)
.zoneId(fooZones.applyValue(getZonesResult -> getZonesResult.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.getSnapshots(GetSnapshotsArgs.builder()
.ids(fooSnapshot.stream().map(element -> element.id()).collect(toList()))
.build());
}
}
Example coming soon!
Using getSnapshots
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 getSnapshots(args: GetSnapshotsArgs, opts?: InvokeOptions): Promise<GetSnapshotsResult>
function getSnapshotsOutput(args: GetSnapshotsOutputArgs, opts?: InvokeOptions): Output<GetSnapshotsResult>def get_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[GetSnapshotsTag]] = None,
zone_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSnapshotsResult
def get_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[GetSnapshotsTagArgs]]]] = None,
zone_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSnapshotsResult]func GetSnapshots(ctx *Context, args *GetSnapshotsArgs, opts ...InvokeOption) (*GetSnapshotsResult, error)
func GetSnapshotsOutput(ctx *Context, args *GetSnapshotsOutputArgs, opts ...InvokeOption) GetSnapshotsResultOutput> Note: This function is named GetSnapshots in the Go SDK.
public static class GetSnapshots
{
public static Task<GetSnapshotsResult> InvokeAsync(GetSnapshotsArgs args, InvokeOptions? opts = null)
public static Output<GetSnapshotsResult> Invoke(GetSnapshotsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSnapshotsResult> getSnapshots(GetSnapshotsArgs args, InvokeOptions options)
public static Output<GetSnapshotsResult> getSnapshots(GetSnapshotsArgs args, InvokeOptions options)
fn::invoke:
function: volcengine:ebs/getSnapshots:getSnapshots
arguments:
# arguments dictionaryThe following arguments are supported:
- Ids List<string>
- A list of snapshot IDs.
- Name
Regex string - A Name Regex of Resource.
- Output
File string - File name where to save data source results.
- Project
Name string - The project name of snapshot.
- Snapshot
Statuses List<string> - A list of snapshot status.
-
List<Get
Snapshots Tag> - Tags.
- Zone
Id string - The zone id of snapshot.
- Ids []string
- A list of snapshot IDs.
- Name
Regex string - A Name Regex of Resource.
- Output
File string - File name where to save data source results.
- Project
Name string - The project name of snapshot.
- Snapshot
Statuses []string - A list of snapshot status.
-
[]Get
Snapshots Tag - Tags.
- Zone
Id string - The zone id of snapshot.
- ids List<String>
- A list of snapshot IDs.
- name
Regex String - A Name Regex of Resource.
- output
File String - File name where to save data source results.
- project
Name String - The project name of snapshot.
- snapshot
Statuses List<String> - A list of snapshot status.
-
List<Get
Snapshots Tag> - Tags.
- zone
Id String - The zone id of snapshot.
- ids string[]
- A list of snapshot IDs.
- name
Regex string - A Name Regex of Resource.
- output
File string - File name where to save data source results.
- project
Name string - The project name of snapshot.
- snapshot
Statuses string[] - A list of snapshot status.
-
Get
Snapshots Tag[] - Tags.
- zone
Id 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.
-
Sequence[Get
Snapshots Tag] - Tags.
- zone_
id str - The zone id of snapshot.
- ids List<String>
- A list of snapshot IDs.
- name
Regex String - A Name Regex of Resource.
- output
File String - File name where to save data source results.
- project
Name String - The project name of snapshot.
- snapshot
Statuses List<String> - A list of snapshot status.
- List<Property Map>
- Tags.
- zone
Id String - The zone id of snapshot.
getSnapshots Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Snapshots
List<Get
Snapshots Snapshot> - The collection of query.
- Total
Count int - The total count of query.
- Ids List<string>
- Name
Regex string - Output
File string - Project
Name string - The project name of the snapshot.
- Snapshot
Statuses List<string> -
List<Get
Snapshots Tag> - Tags.
- Zone
Id string - The zone id of the snapshot.
- Id string
- The provider-assigned unique ID for this managed resource.
- Snapshots
[]Get
Snapshots Snapshot - The collection of query.
- Total
Count int - The total count of query.
- Ids []string
- Name
Regex string - Output
File string - Project
Name string - The project name of the snapshot.
- Snapshot
Statuses []string -
[]Get
Snapshots Tag - Tags.
- Zone
Id string - The zone id of the snapshot.
- id String
- The provider-assigned unique ID for this managed resource.
- snapshots
List<Get
Snapshots Snapshot> - The collection of query.
- total
Count Integer - The total count of query.
- ids List<String>
- name
Regex String - output
File String - project
Name String - The project name of the snapshot.
- snapshot
Statuses List<String> -
List<Get
Snapshots Tag> - Tags.
- zone
Id String - The zone id of the snapshot.
- id string
- The provider-assigned unique ID for this managed resource.
- snapshots
Get
Snapshots Snapshot[] - The collection of query.
- total
Count number - The total count of query.
- ids string[]
- name
Regex string - output
File string - project
Name string - The project name of the snapshot.
- snapshot
Statuses string[] -
Get
Snapshots Tag[] - Tags.
- zone
Id string - The zone id of the snapshot.
- id str
- The provider-assigned unique ID for this managed resource.
- snapshots
Sequence[Get
Snapshots Snapshot] - 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] -
Sequence[Get
Snapshots Tag] - 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.
- total
Count Number - The total count of query.
- ids List<String>
- name
Regex String - output
File String - project
Name String - The project name of the snapshot.
- snapshot
Statuses List<String> - List<Property Map>
- Tags.
- zone
Id String - The zone id of the snapshot.
Supporting Types
GetSnapshotsSnapshot
- Creation
Time string - The creation time of the snapshot.
- Description string
- The description of the snapshot.
- Id string
- The id of the snapshot.
- Project
Name string - The project name of snapshot.
- Retention
Days int - The retention days of the snapshot.
- Snapshot
Id string - The id of the snapshot.
- Snapshot
Name string - The name of the snapshot.
- Snapshot
Type string - The type of the snapshot.
- Status string
- The status of the snapshot.
-
List<Get
Snapshots Snapshot Tag> - Tags.
- Volume
Id string - The volume id of the snapshot.
- Volume
Kind string - The volume kind of the snapshot.
- Volume
Name string - The volume name of the snapshot.
- Volume
Size int - The volume size of the snapshot.
- Volume
Status string - The volume status of the snapshot.
- Volume
Type string - The volume type of the snapshot.
- Zone
Id string - The zone id of snapshot.
- Creation
Time string - The creation time of the snapshot.
- Description string
- The description of the snapshot.
- Id string
- The id of the snapshot.
- Project
Name string - The project name of snapshot.
- Retention
Days int - The retention days of the snapshot.
- Snapshot
Id string - The id of the snapshot.
- Snapshot
Name string - The name of the snapshot.
- Snapshot
Type string - The type of the snapshot.
- Status string
- The status of the snapshot.
-
[]Get
Snapshots Snapshot Tag - Tags.
- Volume
Id string - The volume id of the snapshot.
- Volume
Kind string - The volume kind of the snapshot.
- Volume
Name string - The volume name of the snapshot.
- Volume
Size int - The volume size of the snapshot.
- Volume
Status string - The volume status of the snapshot.
- Volume
Type string - The volume type of the snapshot.
- Zone
Id string - The zone id of snapshot.
- creation
Time String - The creation time of the snapshot.
- description String
- The description of the snapshot.
- id String
- The id of the snapshot.
- project
Name String - The project name of snapshot.
- retention
Days Integer - The retention days of the snapshot.
- snapshot
Id String - The id of the snapshot.
- snapshot
Name String - The name of the snapshot.
- snapshot
Type String - The type of the snapshot.
- status String
- The status of the snapshot.
-
List<Get
Snapshots Snapshot Tag> - Tags.
- volume
Id String - The volume id of the snapshot.
- volume
Kind String - The volume kind of the snapshot.
- volume
Name String - The volume name of the snapshot.
- volume
Size Integer - The volume size of the snapshot.
- volume
Status String - The volume status of the snapshot.
- volume
Type String - The volume type of the snapshot.
- zone
Id String - The zone id of snapshot.
- creation
Time string - The creation time of the snapshot.
- description string
- The description of the snapshot.
- id string
- The id of the snapshot.
- project
Name string - The project name of snapshot.
- retention
Days number - The retention days of the snapshot.
- snapshot
Id string - The id of the snapshot.
- snapshot
Name string - The name of the snapshot.
- snapshot
Type string - The type of the snapshot.
- status string
- The status of the snapshot.
-
Get
Snapshots Snapshot Tag[] - Tags.
- volume
Id string - The volume id of the snapshot.
- volume
Kind string - The volume kind of the snapshot.
- volume
Name string - The volume name of the snapshot.
- volume
Size number - The volume size of the snapshot.
- volume
Status string - The volume status of the snapshot.
- volume
Type string - The volume type of the snapshot.
- zone
Id string - The zone id of snapshot.
- creation_
time str - The creation time of the snapshot.
- description str
- The description of the snapshot.
- id str
- The id of the snapshot.
- project_
name str - The project name of snapshot.
- retention_
days int - The retention days of the snapshot.
- snapshot_
id str - The id of the snapshot.
- snapshot_
name str - The name of the snapshot.
- snapshot_
type str - The type of the snapshot.
- status str
- The status of the snapshot.
-
Sequence[Get
Snapshots Snapshot Tag] - Tags.
- volume_
id str - The volume id of the snapshot.
- volume_
kind str - The volume kind of the snapshot.
- volume_
name str - The volume name of the snapshot.
- volume_
size int - The volume size of the snapshot.
- volume_
status str - The volume status of the snapshot.
- volume_
type str - The volume type of the snapshot.
- zone_
id str - The zone id of snapshot.
- creation
Time String - The creation time of the snapshot.
- description String
- The description of the snapshot.
- id String
- The id of the snapshot.
- project
Name String - The project name of snapshot.
- retention
Days Number - The retention days of the snapshot.
- snapshot
Id String - The id of the snapshot.
- snapshot
Name String - The name of the snapshot.
- snapshot
Type String - The type of the snapshot.
- status String
- The status of the snapshot.
- List<Property Map>
- Tags.
- volume
Id String - The volume id of the snapshot.
- volume
Kind String - The volume kind of the snapshot.
- volume
Name String - The volume name of the snapshot.
- volume
Size Number - The volume size of the snapshot.
- volume
Status String - The volume status of the snapshot.
- volume
Type String - The volume type of the snapshot.
- zone
Id String - The zone id of snapshot.
GetSnapshotsSnapshotTag
GetSnapshotsTag
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengineTerraform Provider.
Volcengine v0.0.38 published on Friday, Oct 31, 2025 by Volcengine
