Viewing docs for ucloud 1.42.0
published on Friday, Sep 11, 2026 by ucloud
published on Friday, Sep 11, 2026 by ucloud
Viewing docs for ucloud 1.42.0
published on Friday, Sep 11, 2026 by ucloud
published on Friday, Sep 11, 2026 by ucloud
This data source provides a list of Disk Snapshot resources according to their availability zone, source disk ID, snapshot ID and name.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ucloud from "@pulumi/ucloud";
const example = ucloud.getDiskSnapshots({
availabilityZone: "cn-bj2-02",
});
export const first = example.then(example => example.snapshots?.[0]?.id);
import pulumi
import pulumi_ucloud as ucloud
example = ucloud.get_disk_snapshots(availability_zone="cn-bj2-02")
pulumi.export("first", example.snapshots[0].id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ucloud.GetDiskSnapshots(ctx, &ucloud.GetDiskSnapshotsArgs{
AvailabilityZone: pulumi.StringRef("cn-bj2-02"),
}, nil)
if err != nil {
return err
}
ctx.Export("first", example.Snapshots[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ucloud = Pulumi.Ucloud;
return await Deployment.RunAsync(() =>
{
var example = Ucloud.GetDiskSnapshots.Invoke(new()
{
AvailabilityZone = "cn-bj2-02",
});
return new Dictionary<string, object?>
{
["first"] = example.Apply(getDiskSnapshotsResult => getDiskSnapshotsResult.Snapshots[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ucloud.UcloudFunctions;
import com.pulumi.ucloud.inputs.GetDiskSnapshotsArgs;
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 example = UcloudFunctions.getDiskSnapshots(GetDiskSnapshotsArgs.builder()
.availabilityZone("cn-bj2-02")
.build());
ctx.export("first", example.snapshots()[0].id());
}
}
variables:
example:
fn::invoke:
function: ucloud:getDiskSnapshots
arguments:
availabilityZone: cn-bj2-02
outputs:
first: ${example.snapshots[0].id}
Example coming soon!
Using getDiskSnapshots
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 getDiskSnapshots(args: GetDiskSnapshotsArgs, opts?: InvokeOptions): Promise<GetDiskSnapshotsResult>
function getDiskSnapshotsOutput(args: GetDiskSnapshotsOutputArgs, opts?: InvokeOutputOptions): Output<GetDiskSnapshotsResult>def get_disk_snapshots(availability_zone: Optional[str] = None,
disk_id: Optional[str] = None,
id: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDiskSnapshotsResult
def get_disk_snapshots_output(availability_zone: pulumi.Input[Optional[str]] = None,
disk_id: pulumi.Input[Optional[str]] = None,
id: pulumi.Input[Optional[str]] = None,
ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
name_regex: pulumi.Input[Optional[str]] = None,
output_file: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetDiskSnapshotsResult]func GetDiskSnapshots(ctx *Context, args *GetDiskSnapshotsArgs, opts ...InvokeOption) (*GetDiskSnapshotsResult, error)
func GetDiskSnapshotsOutput(ctx *Context, args *GetDiskSnapshotsOutputArgs, opts ...InvokeOption) GetDiskSnapshotsResultOutput> Note: This function is named GetDiskSnapshots in the Go SDK.
public static class GetDiskSnapshots
{
public static Task<GetDiskSnapshotsResult> InvokeAsync(GetDiskSnapshotsArgs args, InvokeOptions? opts = null)
public static Output<GetDiskSnapshotsResult> Invoke(GetDiskSnapshotsInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetDiskSnapshotsResult> Invoke(GetDiskSnapshotsInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetDiskSnapshotsResult> getDiskSnapshots(GetDiskSnapshotsArgs args, InvokeOptions options)
public static Output<GetDiskSnapshotsResult> getDiskSnapshots(GetDiskSnapshotsArgs args, InvokeOptions options)
public static Output<GetDiskSnapshotsResult> getDiskSnapshots(GetDiskSnapshotsArgs args, InvokeOutputOptions options)
fn::invoke:
function: ucloud:index/getDiskSnapshots:getDiskSnapshots
arguments:
# arguments dictionarydata "ucloud_get_disk_snapshots" "name" {
# arguments
}The following arguments are supported:
- Availability
Zone string - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - Disk
Id string - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - Id string
- The ID of the snapshot.
- Ids List<string>
- A list of snapshot IDs, all the snapshots belong to this region will be retrieved if the ID is
[]. - Name
Regex string - A regex string to filter the resulting snapshots by name.
- Output
File string - File name where to save data source results (after running
pulumi preview).
- Availability
Zone string - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - Disk
Id string - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - Id string
- The ID of the snapshot.
- Ids []string
- A list of snapshot IDs, all the snapshots belong to this region will be retrieved if the ID is
[]. - Name
Regex string - A regex string to filter the resulting snapshots by name.
- Output
File string - File name where to save data source results (after running
pulumi preview).
- availability_
zone string - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - disk_
id string - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - id string
- The ID of the snapshot.
- ids list(string)
- A list of snapshot IDs, all the snapshots belong to this region will be retrieved if the ID is
[]. - name_
regex string - A regex string to filter the resulting snapshots by name.
- output_
file string - File name where to save data source results (after running
pulumi preview).
- availability
Zone String - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - disk
Id String - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - id String
- The ID of the snapshot.
- ids List<String>
- A list of snapshot IDs, all the snapshots belong to this region will be retrieved if the ID is
[]. - name
Regex String - A regex string to filter the resulting snapshots by name.
- output
File String - File name where to save data source results (after running
pulumi preview).
- availability
Zone string - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - disk
Id string - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - id string
- The ID of the snapshot.
- ids string[]
- A list of snapshot IDs, all the snapshots belong to this region will be retrieved if the ID is
[]. - name
Regex string - A regex string to filter the resulting snapshots by name.
- output
File string - File name where to save data source results (after running
pulumi preview).
- availability_
zone str - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - disk_
id str - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - id str
- The ID of the snapshot.
- ids Sequence[str]
- A list of snapshot IDs, all the snapshots belong to this region will be retrieved if the ID is
[]. - name_
regex str - A regex string to filter the resulting snapshots by name.
- output_
file str - File name where to save data source results (after running
pulumi preview).
- availability
Zone String - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - disk
Id String - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - id String
- The ID of the snapshot.
- ids List<String>
- A list of snapshot IDs, all the snapshots belong to this region will be retrieved if the ID is
[]. - name
Regex String - A regex string to filter the resulting snapshots by name.
- output
File String - File name where to save data source results (after running
pulumi preview).
getDiskSnapshots Result
The following output properties are available:
- Id string
- The ID of the snapshot.
- Ids List<string>
- Snapshots
List<Get
Disk Snapshots Snapshot> - It is a nested type which documented below.
- Total
Count double - Total number of snapshots that satisfy the condition.
- Availability
Zone string - Availability zone where the snapshot is located.
- Disk
Id string - The ID of the cloud disk which the snapshot is created from.
- Name
Regex string - Output
File string
- Id string
- The ID of the snapshot.
- Ids []string
- Snapshots
[]Get
Disk Snapshots Snapshot - It is a nested type which documented below.
- Total
Count float64 - Total number of snapshots that satisfy the condition.
- Availability
Zone string - Availability zone where the snapshot is located.
- Disk
Id string - The ID of the cloud disk which the snapshot is created from.
- Name
Regex string - Output
File string
- id string
- The ID of the snapshot.
- ids list(string)
- snapshots list(object)
- It is a nested type which documented below.
- total_
count number - Total number of snapshots that satisfy the condition.
- availability_
zone string - Availability zone where the snapshot is located.
- disk_
id string - The ID of the cloud disk which the snapshot is created from.
- name_
regex string - output_
file string
- id String
- The ID of the snapshot.
- ids List<String>
- snapshots
List<Get
Disk Snapshots Snapshot> - It is a nested type which documented below.
- total
Count Double - Total number of snapshots that satisfy the condition.
- availability
Zone String - Availability zone where the snapshot is located.
- disk
Id String - The ID of the cloud disk which the snapshot is created from.
- name
Regex String - output
File String
- id string
- The ID of the snapshot.
- ids string[]
- snapshots
Get
Disk Snapshots Snapshot[] - It is a nested type which documented below.
- total
Count number - Total number of snapshots that satisfy the condition.
- availability
Zone string - Availability zone where the snapshot is located.
- disk
Id string - The ID of the cloud disk which the snapshot is created from.
- name
Regex string - output
File string
- id str
- The ID of the snapshot.
- ids Sequence[str]
- snapshots
Sequence[Get
Disk Snapshots Snapshot] - It is a nested type which documented below.
- total_
count float - Total number of snapshots that satisfy the condition.
- availability_
zone str - Availability zone where the snapshot is located.
- disk_
id str - The ID of the cloud disk which the snapshot is created from.
- name_
regex str - output_
file str
- id String
- The ID of the snapshot.
- ids List<String>
- snapshots List<Property Map>
- It is a nested type which documented below.
- total
Count Number - Total number of snapshots that satisfy the condition.
- availability
Zone String - Availability zone where the snapshot is located.
- disk
Id String - The ID of the cloud disk which the snapshot is created from.
- name
Regex String - output
File String
Supporting Types
GetDiskSnapshotsSnapshot
- Availability
Zone string - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - Comment string
- The description of the snapshot.
- Create
Time string - The time of creation of the snapshot, formatted in RFC3339 time string.
- Disk
Id string - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - Disk
Type string - The type of the source disk. Possible values are:
data_diskas cloud disk,ssd_data_diskas ssd cloud disk,rssd_data_diskas RDMA-SSD cloud disk,system_diskas cloud system disk,ssd_system_diskas ssd cloud system disk. - Id string
- The ID of the snapshot.
- Is
Disk boolAvailable - Whether the source disk of the snapshot is available.
- Name string
- The name of the snapshot.
- Size double
- The size of the snapshot in GB.
- Source
Disk stringName - The name of the cloud disk which the snapshot is created from.
- Status string
- The status of the snapshot. Possible values are:
Normal,Failed,Creating.
- Availability
Zone string - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - Comment string
- The description of the snapshot.
- Create
Time string - The time of creation of the snapshot, formatted in RFC3339 time string.
- Disk
Id string - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - Disk
Type string - The type of the source disk. Possible values are:
data_diskas cloud disk,ssd_data_diskas ssd cloud disk,rssd_data_diskas RDMA-SSD cloud disk,system_diskas cloud system disk,ssd_system_diskas ssd cloud system disk. - Id string
- The ID of the snapshot.
- Is
Disk boolAvailable - Whether the source disk of the snapshot is available.
- Name string
- The name of the snapshot.
- Size float64
- The size of the snapshot in GB.
- Source
Disk stringName - The name of the cloud disk which the snapshot is created from.
- Status string
- The status of the snapshot. Possible values are:
Normal,Failed,Creating.
- availability_
zone string - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - comment string
- The description of the snapshot.
- create_
time string - The time of creation of the snapshot, formatted in RFC3339 time string.
- disk_
id string - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - disk_
type string - The type of the source disk. Possible values are:
data_diskas cloud disk,ssd_data_diskas ssd cloud disk,rssd_data_diskas RDMA-SSD cloud disk,system_diskas cloud system disk,ssd_system_diskas ssd cloud system disk. - id string
- The ID of the snapshot.
- is_
disk_ boolavailable - Whether the source disk of the snapshot is available.
- name string
- The name of the snapshot.
- size number
- The size of the snapshot in GB.
- source_
disk_ stringname - The name of the cloud disk which the snapshot is created from.
- status string
- The status of the snapshot. Possible values are:
Normal,Failed,Creating.
- availability
Zone String - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - comment String
- The description of the snapshot.
- create
Time String - The time of creation of the snapshot, formatted in RFC3339 time string.
- disk
Id String - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - disk
Type String - The type of the source disk. Possible values are:
data_diskas cloud disk,ssd_data_diskas ssd cloud disk,rssd_data_diskas RDMA-SSD cloud disk,system_diskas cloud system disk,ssd_system_diskas ssd cloud system disk. - id String
- The ID of the snapshot.
- is
Disk BooleanAvailable - Whether the source disk of the snapshot is available.
- name String
- The name of the snapshot.
- size Double
- The size of the snapshot in GB.
- source
Disk StringName - The name of the cloud disk which the snapshot is created from.
- status String
- The status of the snapshot. Possible values are:
Normal,Failed,Creating.
- availability
Zone string - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - comment string
- The description of the snapshot.
- create
Time string - The time of creation of the snapshot, formatted in RFC3339 time string.
- disk
Id string - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - disk
Type string - The type of the source disk. Possible values are:
data_diskas cloud disk,ssd_data_diskas ssd cloud disk,rssd_data_diskas RDMA-SSD cloud disk,system_diskas cloud system disk,ssd_system_diskas ssd cloud system disk. - id string
- The ID of the snapshot.
- is
Disk booleanAvailable - Whether the source disk of the snapshot is available.
- name string
- The name of the snapshot.
- size number
- The size of the snapshot in GB.
- source
Disk stringName - The name of the cloud disk which the snapshot is created from.
- status string
- The status of the snapshot. Possible values are:
Normal,Failed,Creating.
- availability_
zone str - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - comment str
- The description of the snapshot.
- create_
time str - The time of creation of the snapshot, formatted in RFC3339 time string.
- disk_
id str - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - disk_
type str - The type of the source disk. Possible values are:
data_diskas cloud disk,ssd_data_diskas ssd cloud disk,rssd_data_diskas RDMA-SSD cloud disk,system_diskas cloud system disk,ssd_system_diskas ssd cloud system disk. - id str
- The ID of the snapshot.
- is_
disk_ boolavailable - Whether the source disk of the snapshot is available.
- name str
- The name of the snapshot.
- size float
- The size of the snapshot in GB.
- source_
disk_ strname - The name of the cloud disk which the snapshot is created from.
- status str
- The status of the snapshot. Possible values are:
Normal,Failed,Creating.
- availability
Zone String - Availability zone where the snapshots are located. Such as: "cn-bj2-02". You may refer to list of availability zone. It is required when
disk_idis set. - comment String
- The description of the snapshot.
- create
Time String - The time of creation of the snapshot, formatted in RFC3339 time string.
- disk
Id String - The ID of the cloud disk which the snapshots are created from. The
availability_zonemust be set at the same time. - disk
Type String - The type of the source disk. Possible values are:
data_diskas cloud disk,ssd_data_diskas ssd cloud disk,rssd_data_diskas RDMA-SSD cloud disk,system_diskas cloud system disk,ssd_system_diskas ssd cloud system disk. - id String
- The ID of the snapshot.
- is
Disk BooleanAvailable - Whether the source disk of the snapshot is available.
- name String
- The name of the snapshot.
- size Number
- The size of the snapshot in GB.
- source
Disk StringName - The name of the cloud disk which the snapshot is created from.
- status String
- The status of the snapshot. Possible values are:
Normal,Failed,Creating.
Package Details
- Repository
- ucloud ucloud/terraform-provider-ucloud
- License
- Notes
- This Pulumi package is based on the
ucloudTerraform Provider.
Viewing docs for ucloud 1.42.0
published on Friday, Sep 11, 2026 by ucloud
published on Friday, Sep 11, 2026 by ucloud