getEcsSnapshotGroups

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

NOTE: Available in v1.160.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.GetEcsSnapshotGroupsArgs;
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 ids = EcsFunctions.getEcsSnapshotGroups(GetEcsSnapshotGroupsArgs.builder()
.ids("example-id")
.build());
ctx.export("ecsSnapshotGroupId1", ids.applyValue(getEcsSnapshotGroupsResult -> getEcsSnapshotGroupsResult.groups()[0].id()));
final var nameRegex = EcsFunctions.getEcsSnapshotGroups(GetEcsSnapshotGroupsArgs.builder()
.nameRegex("^my-SnapshotGroup")
.build());
ctx.export("ecsSnapshotGroupId2", nameRegex.applyValue(getEcsSnapshotGroupsResult -> getEcsSnapshotGroupsResult.groups()[0].id()));
final var status = EcsFunctions.getEcsSnapshotGroups(GetEcsSnapshotGroupsArgs.builder()
.status("accomplished")
.build());
ctx.export("ecsSnapshotGroupId3", status.applyValue(getEcsSnapshotGroupsResult -> getEcsSnapshotGroupsResult.groups()[0].id()));
final var instanceId = EcsFunctions.getEcsSnapshotGroups(GetEcsSnapshotGroupsArgs.builder()
.instanceId("example-instance_id")
.build());
ctx.export("ecsSnapshotGroupId4", instanceId.applyValue(getEcsSnapshotGroupsResult -> getEcsSnapshotGroupsResult.groups()[0].id()));
}
}

Return

A collection of values returned by getEcsSnapshotGroups.

Parameters

argument

A collection of arguments for invoking getEcsSnapshotGroups.


suspend fun getEcsSnapshotGroups(ids: List<String>? = null, instanceId: String? = null, nameRegex: String? = null, outputFile: String? = null, snapshotGroupName: String? = null, status: String? = null, tags: Map<String, Any>? = null): GetEcsSnapshotGroupsResult

Return

A collection of values returned by getEcsSnapshotGroups.

See also

Parameters

ids

A list of Snapshot Group IDs.

instanceId

The ID of the instance.

nameRegex

A regex string to filter results by Snapshot Group name.

outputFile

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

snapshotGroupName

The name of the snapshot-consistent group.

status

The status of the resource.

tags

List of label key-value pairs.


Return

A collection of values returned by getEcsSnapshotGroups.

See also

Parameters

argument

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