getSnapshots

DEPRECATED: This datasource has been renamed to alicloud.ecs.getEcsSnapshots from version 1.120.0. Use this data source to get a list of snapshot according to the specified filters in an Alibaba Cloud account. For information about snapshot and how to use it, see Snapshot. NOTE: Available in 1.40.0+.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const snapshots = alicloud.ecs.getSnapshots({
ids: ["s-123456890abcdef"],
nameRegex: "tf-testAcc-snapshot",
});
import pulumi
import pulumi_alicloud as alicloud
snapshots = alicloud.ecs.get_snapshots(ids=["s-123456890abcdef"],
name_regex="tf-testAcc-snapshot")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var snapshots = AliCloud.Ecs.GetSnapshots.Invoke(new()
{
Ids = new[]
{
"s-123456890abcdef",
},
NameRegex = "tf-testAcc-snapshot",
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ecs.GetSnapshots(ctx, &ecs.GetSnapshotsArgs{
Ids: []string{
"s-123456890abcdef",
},
NameRegex: pulumi.StringRef("tf-testAcc-snapshot"),
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetSnapshotsArgs;
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 snapshots = EcsFunctions.getSnapshots(GetSnapshotsArgs.builder()
.ids("s-123456890abcdef")
.nameRegex("tf-testAcc-snapshot")
.build());
}
}
variables:
snapshots:
fn::invoke:
function: alicloud:ecs:getSnapshots
arguments:
ids:
- s-123456890abcdef
nameRegex: tf-testAcc-snapshot

Argument Reference

The following arguments are supported:

  • instance_id - (Optional) The specified instance ID.

  • disk_id - (Optional) The specified disk ID.

  • encrypted - (Optional) Queries the encrypted snapshots. Optional values: true: Encrypted snapshots. false: No encryption attribute limit. Default value: false.

  • ids - (Optional) A list of snapshot IDs.

  • name_regex - (Optional) A regex string to filter results by snapshot name.

  • status - (Optional) The specified snapshot status. Default value: all. Optional values:

  • progressing: The snapshots are being created.

  • accomplished: The snapshots are ready to use.

  • failed: The snapshot creation failed.

  • all: All status.

  • type - (Optional) The snapshot category. Default value: all. Optional values:

  • auto: Auto snapshots.

  • user: Manual snapshots.

  • all: Auto and manual snapshots.

  • source_disk_type - (Optional) The type of source disk:

  • System: The snapshots are created for system disks.

  • Data: The snapshots are created for data disks.

  • usage - (Optional) The usage of the snapshot:

  • image: The snapshots are used to create custom images.

  • disk: The snapshots are used to CreateDisk.

  • mage_disk: The snapshots are used to create custom images and data disks.

  • none: The snapshots are not used yet.

  • tags - (Optional) A map of tags assigned to snapshots.

  • output_file - (Optional) The name of output file that saves the filter results.

Return

A collection of values returned by getSnapshots.

Parameters

argument

A collection of arguments for invoking getSnapshots.


suspend fun getSnapshots(category: String? = null, dryRun: Boolean? = null, encrypted: Boolean? = null, ids: List<String>? = null, kmsKeyId: String? = null, nameRegex: String? = null, outputFile: String? = null, resourceGroupId: String? = null, snapshotLinkId: String? = null, snapshotName: String? = null, snapshotType: String? = null, sourceDiskType: String? = null, status: String? = null, tags: Map<String, String>? = null, type: String? = null, usage: String? = null): GetSnapshotsResult

Return

A collection of values returned by getSnapshots.

Parameters

category
dryRun
encrypted

Whether the snapshot is encrypted or not.

ids

A list of snapshot IDs.

kmsKeyId
nameRegex
outputFile
resourceGroupId
snapshotLinkId
snapshotName
snapshotType
sourceDiskType

Source disk attribute. Value range: System,Data.

status

The snapshot status. Value range: progressing, accomplished and failed.

tags

A map of tags assigned to the snapshot.

type
usage

Whether the snapshots are used to create resources or not. Value range: image, disk, image_disk and none.

See also


Return

A collection of values returned by getSnapshots.

Parameters

argument

Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetSnapshotsPlainArgs.

See also