getEcsDisks

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

NOTE: Available in v1.122.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.ecs.getEcsDisks({
ids: ["d-artgdsvdvxxxx"],
nameRegex: "tf-test",
});
export const firstEcsDiskId = example.then(example => example.disks?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.ecs.get_ecs_disks(ids=["d-artgdsvdvxxxx"],
name_regex="tf-test")
pulumi.export("firstEcsDiskId", example.disks[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = AliCloud.Ecs.GetEcsDisks.Invoke(new()
{
Ids = new[]
{
"d-artgdsvdvxxxx",
},
NameRegex = "tf-test",
});
return new Dictionary<string, object?>
{
["firstEcsDiskId"] = example&#46;Apply(getEcsDisksResult => getEcsDisksResult&#46;Disks[0]?.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ecs.GetEcsDisks(ctx, &ecs.GetEcsDisksArgs{
Ids: []string{
"d-artgdsvdvxxxx",
},
NameRegex: pulumi.StringRef("tf-test"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstEcsDiskId", example.Disks[0].Id)
return nil
})
}
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.GetEcsDisksArgs;
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.getEcsDisks(GetEcsDisksArgs.builder()
.ids("d-artgdsvdvxxxx")
.nameRegex("tf-test")
.build());
ctx.export("firstEcsDiskId", example.applyValue(getEcsDisksResult -> getEcsDisksResult.disks()[0].id()));
}
}
variables:
example:
fn::invoke:
Function: alicloud:ecs:getEcsDisks
Arguments:
ids:
- d-artgdsvdvxxxx
nameRegex: tf-test
outputs:
firstEcsDiskId: ${example.disks[0].id}

Return

A collection of values returned by getEcsDisks.

Parameters

argument

A collection of arguments for invoking getEcsDisks.


suspend fun getEcsDisks(additionalAttributes: List<String>? = null, autoSnapshotPolicyId: String? = null, availabilityZone: String? = null, category: String? = null, deleteAutoSnapshot: Boolean? = null, deleteWithInstance: Boolean? = null, diskName: String? = null, diskType: String? = null, dryRun: Boolean? = null, enableAutoSnapshot: Boolean? = null, enableAutomatedSnapshotPolicy: Boolean? = null, enableShared: Boolean? = null, encrypted: String? = null, ids: List<String>? = null, instanceId: String? = null, kmsKeyId: String? = null, nameRegex: String? = null, operationLocks: List<GetEcsDisksOperationLock>? = null, outputFile: String? = null, pageNumber: Int? = null, pageSize: Int? = null, paymentType: String? = null, portable: Boolean? = null, resourceGroupId: String? = null, snapshotId: String? = null, status: String? = null, tags: Map<String, Any>? = null, type: String? = null, zoneId: String? = null): GetEcsDisksResult

Return

A collection of values returned by getEcsDisks.

Parameters

additionalAttributes

Other attribute values. Currently, only the incoming value of IOPS is supported, which means to query the IOPS upper limit of the current disk.

autoSnapshotPolicyId

Query cloud disks based on the automatic snapshot policy ID.

availabilityZone

Field availability_zone has been deprecated from provider version 1.122.0. New field zone_id instead.

category

Disk category. Valid values: cloud, cloud_efficiency, cloud_essd, cloud_ssd, ephemeral_ssd, cloud_auto, cloud_essd_entry.

deleteAutoSnapshot

Indicates whether the automatic snapshot is deleted when the disk is released.

deleteWithInstance

Indicates whether the disk is released together with the instance.

diskName

The disk name.

diskType

The disk type.

dryRun

Specifies whether to check the validity of the request without actually making the request.request Default value: false. Valid values:

enableAutoSnapshot

Indicates whether the automatic snapshot is deleted when the disk is released.

enableAutomatedSnapshotPolicy

Whether the cloud disk has an automatic snapshot policy

enableShared

Whether it is shared block storage.

encrypted

Indicate whether the disk is encrypted or not. Possible values: on and off.

ids

A list of Disk IDs.

instanceId

Filter the results by the specified ECS instance ID.

kmsKeyId

The kms key id.

nameRegex

A regex string to filter results by Disk name.

operationLocks
outputFile

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

pageNumber
pageSize
paymentType

Payment method for disk. Valid Values: PayAsYouGo, Subscription.

portable

Whether the cloud disk or local disk supports uninstallation.

resourceGroupId

The Id of resource group which the disk belongs.

snapshotId

The source snapshot id.

status

The status of disk.

tags

A map of tags assigned to the disks.

type

Field type has been deprecated from provider version 1.122.0. New field disk_type instead.

zoneId

ID of the free zone to which the disk belongs.

See also


suspend fun getEcsDisks(argument: suspend GetEcsDisksPlainArgsBuilder.() -> Unit): GetEcsDisksResult

Return

A collection of values returned by getEcsDisks.

Parameters

argument

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

See also