GetSnapshots
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+.
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.
* The snapshot status. Optional values:
* progressing: The snapshots are being created.
* accomplished: The snapshots are ready to use.
* failed: The snapshot creation failed.
* all: All status.
Default value: all.
type- (Optional) The snapshot category. Optional values:- auto: Auto snapshots.
- user: Manual snapshots.
- all: Auto and manual snapshots.
Default value: all.
* 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.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var snapshots = Output.Create(AliCloud.Ecs.GetSnapshots.InvokeAsync(new AliCloud.Ecs.GetSnapshotsArgs
{
Ids =
{
"s-123456890abcdef",
},
NameRegex = "tf-testAcc-snapshot",
}));
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
snapshots = alicloud.ecs.get_snapshots(ids=["s-123456890abcdef"],
name_regex="tf-testAcc-snapshot")import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const snapshots = pulumi.output(alicloud.ecs.getSnapshots({
ids: ["s-123456890abcdef"],
nameRegex: "tf-testAcc-snapshot",
}, { async: true }));Using GetSnapshots
function getSnapshots(args: GetSnapshotsArgs, opts?: InvokeOptions): Promise<GetSnapshotsResult>function get_snapshots(disk_id=None, encrypted=None, ids=None, instance_id=None, name_regex=None, output_file=None, source_disk_type=None, status=None, tags=None, type=None, usage=None, opts=None)func GetSnapshots(ctx *Context, args *GetSnapshotsArgs, opts ...InvokeOption) (*GetSnapshotsResult, error)public static class GetSnapshots {
public static Task<GetSnapshotsResult> InvokeAsync(GetSnapshotsArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Disk
Id string - Encrypted bool
Whether the snapshot is encrypted or not.
- Ids List<string>
A list of snapshot IDs.
- Instance
Id string - Name
Regex string - Output
File string - Source
Disk stringType Source disk attribute. Value range: * System * Data
- Status string
The snapshot status. Value range: * progressing * accomplished * failed
- Dictionary<string, object>
A map of tags assigned to the snapshot.
- Type string
- Usage string
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
- Disk
Id string - Encrypted bool
Whether the snapshot is encrypted or not.
- Ids []string
A list of snapshot IDs.
- Instance
Id string - Name
Regex string - Output
File string - Source
Disk stringType Source disk attribute. Value range: * System * Data
- Status string
The snapshot status. Value range: * progressing * accomplished * failed
- map[string]interface{}
A map of tags assigned to the snapshot.
- Type string
- Usage string
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
- disk
Id string - encrypted boolean
Whether the snapshot is encrypted or not.
- ids string[]
A list of snapshot IDs.
- instance
Id string - name
Regex string - output
File string - source
Disk stringType Source disk attribute. Value range: * System * Data
- status string
The snapshot status. Value range: * progressing * accomplished * failed
- {[key: string]: any}
A map of tags assigned to the snapshot.
- type string
- usage string
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
- disk_
id str - encrypted bool
Whether the snapshot is encrypted or not.
- ids List[str]
A list of snapshot IDs.
- instance_
id str - name_
regex str - output_
file str - source_
disk_ strtype Source disk attribute. Value range: * System * Data
- status str
The snapshot status. Value range: * progressing * accomplished * failed
- Dict[str, Any]
A map of tags assigned to the snapshot.
- type str
- usage str
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
GetSnapshots Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
A list of snapshot IDs.
- Names List<string>
A list of snapshots names.
- Snapshots
List<Pulumi.
Ali Cloud. Ecs. Outputs. Get Snapshots Snapshot> A list of snapshots. Each element contains the following attributes:
- Disk
Id string - Encrypted bool
Whether the snapshot is encrypted or not.
- Instance
Id string - Name
Regex string - Output
File string - Source
Disk stringType Source disk attribute. Value range: * System * Data
- Status string
The snapshot status. Value range: * progressing * accomplished * failed
- Dictionary<string, object>
A map of tags assigned to the snapshot.
- Type string
- Usage string
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
A list of snapshot IDs.
- Names []string
A list of snapshots names.
- Snapshots
[]Get
Snapshots Snapshot A list of snapshots. Each element contains the following attributes:
- Disk
Id string - Encrypted bool
Whether the snapshot is encrypted or not.
- Instance
Id string - Name
Regex string - Output
File string - Source
Disk stringType Source disk attribute. Value range: * System * Data
- Status string
The snapshot status. Value range: * progressing * accomplished * failed
- map[string]interface{}
A map of tags assigned to the snapshot.
- Type string
- Usage string
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
A list of snapshot IDs.
- names string[]
A list of snapshots names.
- snapshots
Get
Snapshots Snapshot[] A list of snapshots. Each element contains the following attributes:
- disk
Id string - encrypted boolean
Whether the snapshot is encrypted or not.
- instance
Id string - name
Regex string - output
File string - source
Disk stringType Source disk attribute. Value range: * System * Data
- status string
The snapshot status. Value range: * progressing * accomplished * failed
- {[key: string]: any}
A map of tags assigned to the snapshot.
- type string
- usage string
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
- id str
The provider-assigned unique ID for this managed resource.
- ids List[str]
A list of snapshot IDs.
- names List[str]
A list of snapshots names.
- snapshots
List[Get
Snapshots Snapshot] A list of snapshots. Each element contains the following attributes:
- disk_
id str - encrypted bool
Whether the snapshot is encrypted or not.
- instance_
id str - name_
regex str - output_
file str - source_
disk_ strtype Source disk attribute. Value range: * System * Data
- status str
The snapshot status. Value range: * progressing * accomplished * failed
- Dict[str, Any]
A map of tags assigned to the snapshot.
- type str
- usage str
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
Supporting Types
GetSnapshotsSnapshot
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Creation
Time string Creation time. Time of creation. It is represented according to ISO8601, and UTC time is used. Format: YYYY-MM-DDThh:mmZ.
- Description string
Description of the snapshot.
- Encrypted bool
Whether the snapshot is encrypted or not.
- Id string
ID of the snapshot.
- Name string
Name of the snapshot.
- Product
Code string Product code on the image market place.
- Progress string
Progress of snapshot creation, presented in percentage.
- Remain
Time int The remaining time of a snapshot creation task, in seconds.
- Retention
Days int The number of days that an automatic snapshot retains in the console for your instance.
- Source
Disk stringId Source disk ID, which is retained after the source disk of the snapshot is deleted.
- Source
Disk stringSize Size of the source disk, measured in GB.
- Source
Disk stringType Source disk attribute. Value range: * System * Data
- Status string
The snapshot status. Value range: * progressing * accomplished * failed
- Usage string
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
- Creation
Time string Creation time. Time of creation. It is represented according to ISO8601, and UTC time is used. Format: YYYY-MM-DDThh:mmZ.
- Description string
Description of the snapshot.
- Encrypted bool
Whether the snapshot is encrypted or not.
- Id string
ID of the snapshot.
- Name string
Name of the snapshot.
- Product
Code string Product code on the image market place.
- Progress string
Progress of snapshot creation, presented in percentage.
- Remain
Time int The remaining time of a snapshot creation task, in seconds.
- Retention
Days int The number of days that an automatic snapshot retains in the console for your instance.
- Source
Disk stringId Source disk ID, which is retained after the source disk of the snapshot is deleted.
- Source
Disk stringSize Size of the source disk, measured in GB.
- Source
Disk stringType Source disk attribute. Value range: * System * Data
- Status string
The snapshot status. Value range: * progressing * accomplished * failed
- Usage string
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
- creation
Time string Creation time. Time of creation. It is represented according to ISO8601, and UTC time is used. Format: YYYY-MM-DDThh:mmZ.
- description string
Description of the snapshot.
- encrypted boolean
Whether the snapshot is encrypted or not.
- id string
ID of the snapshot.
- name string
Name of the snapshot.
- product
Code string Product code on the image market place.
- progress string
Progress of snapshot creation, presented in percentage.
- remain
Time number The remaining time of a snapshot creation task, in seconds.
- retention
Days number The number of days that an automatic snapshot retains in the console for your instance.
- source
Disk stringId Source disk ID, which is retained after the source disk of the snapshot is deleted.
- source
Disk stringSize Size of the source disk, measured in GB.
- source
Disk stringType Source disk attribute. Value range: * System * Data
- status string
The snapshot status. Value range: * progressing * accomplished * failed
- usage string
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
- creation_
time str Creation time. Time of creation. It is represented according to ISO8601, and UTC time is used. Format: YYYY-MM-DDThh:mmZ.
- description str
Description of the snapshot.
- encrypted bool
Whether the snapshot is encrypted or not.
- id str
ID of the snapshot.
- name str
Name of the snapshot.
- product_
code str Product code on the image market place.
- progress str
Progress of snapshot creation, presented in percentage.
- remain
Time float The remaining time of a snapshot creation task, in seconds.
- retention_
days float The number of days that an automatic snapshot retains in the console for your instance.
- source
Disk strId Source disk ID, which is retained after the source disk of the snapshot is deleted.
- source
Disk strSize Size of the source disk, measured in GB.
- source
Disk strType Source disk attribute. Value range: * System * Data
- status str
The snapshot status. Value range: * progressing * accomplished * failed
- usage str
Whether the snapshots are used to create resources or not. Value range: * image * disk * image_disk * none
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.