get Ecs Disks
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.Apply(getEcsDisksResult => getEcsDisksResult.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
A collection of arguments for invoking getEcsDisks.
Return
A collection of values returned by getEcsDisks.
Parameters
Other attribute values. Currently, only the incoming value of IOPS is supported, which means to query the IOPS upper limit of the current disk.
Query cloud disks based on the automatic snapshot policy ID.
Field availability_zone has been deprecated from provider version 1.122.0. New field zone_id instead.
Disk category. Valid values: cloud, cloud_efficiency, cloud_essd, cloud_ssd, ephemeral_ssd, cloud_auto, cloud_essd_entry.
Indicates whether the automatic snapshot is deleted when the disk is released.
Indicates whether the disk is released together with the instance.
The disk name.
The disk type.
Specifies whether to check the validity of the request without actually making the request.request Default value: false. Valid values:
Indicates whether the automatic snapshot is deleted when the disk is released.
Whether the cloud disk has an automatic snapshot policy
Whether it is shared block storage.
Indicate whether the disk is encrypted or not. Possible values: on and off.
A list of Disk IDs.
Filter the results by the specified ECS instance ID.
The kms key id.
A regex string to filter results by Disk name.
File name where to save data source results (after running pulumi preview).
Payment method for disk. Valid Values: PayAsYouGo, Subscription.
Whether the cloud disk or local disk supports uninstallation.
The Id of resource group which the disk belongs.
The source snapshot id.
The status of disk.
A map of tags assigned to the disks.
Field type has been deprecated from provider version 1.122.0. New field disk_type instead.
ID of the free zone to which the disk belongs.
See also
Return
A collection of values returned by getEcsDisks.
Parameters
Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetEcsDisksPlainArgs.