get Ecs Snapshot Groups
suspend fun getEcsSnapshotGroups(argument: GetEcsSnapshotGroupsPlainArgs): GetEcsSnapshotGroupsResult
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()));
}
}
Content copied to clipboard
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.
instance Id
The ID of the instance.
name Regex
A regex string to filter results by Snapshot Group name.
output File
snapshot Group Name
The name of the snapshot-consistent group.
status
The status of the resource.
tags
List of label key-value pairs.
suspend fun getEcsSnapshotGroups(argument: suspend GetEcsSnapshotGroupsPlainArgsBuilder.() -> Unit): GetEcsSnapshotGroupsResult
Return
A collection of values returned by getEcsSnapshotGroups.
See also
Parameters
argument
Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetEcsSnapshotGroupsPlainArgs.