getEcsSnapshots

This data source provides the Ecs Snapshots of the current Alibaba Cloud user.

NOTE: Available in v1.120.0+.

Example Usage

Basic 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.GetEcsSnapshotsArgs;
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 = EcsFunctions.getEcsSnapshots(GetEcsSnapshotsArgs.builder()
.ids("s-bp1fvuxxxxxxxx")
.nameRegex("tf-test")
.build());
ctx.export("firstEcsSnapshotId", example.applyValue(getEcsSnapshotsResult -> getEcsSnapshotsResult.snapshots()[0].id()));
}
}

Return

A collection of values returned by getEcsSnapshots.

Parameters

argument

A collection of arguments for invoking getEcsSnapshots.


suspend fun getEcsSnapshots(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, Any>? = null, type: String? = null, usage: String? = null): GetEcsSnapshotsResult

Return

A collection of values returned by getEcsSnapshots.

See also

Parameters

category

The category of the snapshot.

dryRun

Specifies whether to check the validity of the request without actually making the request.

encrypted

Whether the snapshot is encrypted.

ids

A list of Snapshot IDs.

kmsKeyId

The kms key id.

nameRegex

A regex string to filter results by Snapshot name.

outputFile

File name where to save data source results (after running pulumi preview).

resourceGroupId

The resource group id.

snapshotLinkId

The snapshot link id.

snapshotName

Snapshot Display Name.

snapshotType

Snapshot creation type.

sourceDiskType

Source disk attributes.

status

The status of the snapshot.

tags

The tags.

type
usage

A resource type that has a reference relationship.


Return

A collection of values returned by getEcsSnapshots.

See also

Parameters

argument

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