get Snapshots
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
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());
}
}
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
A collection of arguments for invoking getSnapshots.
Return
A collection of values returned by getSnapshots.
See also
Parameters
Whether the snapshot is encrypted or not.
A list of snapshot IDs.
Source disk attribute. Value range: System
,Data
.
The snapshot status. Value range: progressing
, accomplished
and failed
.
A map of tags assigned to the snapshot.
Whether the snapshots are used to create resources or not. Value range: image
, disk
, image_disk
and none
.
Return
A collection of values returned by getSnapshots.
See also
Parameters
Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetSnapshotsPlainArgs.