GetDisks

This data source provides the disks of the current Alibaba Cloud user.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var disksDs = Output.Create(AliCloud.Ecs.GetDisks.InvokeAsync(new AliCloud.Ecs.GetDisksArgs
        {
            NameRegex = "sample_disk",
        }));
        this.FirstDiskId = disksDs.Apply(disksDs => disksDs.Disks[0].Id);
    }

    [Output("firstDiskId")]
    public Output<string> FirstDiskId { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

disks_ds = alicloud.ecs.get_disks(name_regex="sample_disk")
pulumi.export("firstDiskId", disks_ds.disks[0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const disksDs = pulumi.output(alicloud.ecs.getDisks({
    nameRegex: "sample_disk",
}, { async: true }));

export const firstDiskId = disksDs.disks[0].id;

Using GetDisks

function getDisks(args: GetDisksArgs, opts?: InvokeOptions): Promise<GetDisksResult>
function  get_disks(category=None, encrypted=None, ids=None, instance_id=None, name_regex=None, output_file=None, resource_group_id=None, tags=None, type=None, opts=None)
func GetDisks(ctx *Context, args *GetDisksArgs, opts ...InvokeOption) (*GetDisksResult, error)
public static class GetDisks {
    public static Task<GetDisksResult> InvokeAsync(GetDisksArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Category string

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

Encrypted string

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

Ids List<string>

A list of disks IDs.

InstanceId string

Filter the results by the specified ECS instance ID.

NameRegex string

A regex string to filter results by disk name.

OutputFile string
ResourceGroupId string

The Id of resource group which the disk belongs.

Tags Dictionary<string, object>

A map of tags assigned to the disks. It must be in the format:

data "alicloud.ecs.getDisks" "disks_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
Type string

Disk type. Possible values: system and data.

Category string

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

Encrypted string

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

Ids []string

A list of disks IDs.

InstanceId string

Filter the results by the specified ECS instance ID.

NameRegex string

A regex string to filter results by disk name.

OutputFile string
ResourceGroupId string

The Id of resource group which the disk belongs.

Tags map[string]interface{}

A map of tags assigned to the disks. It must be in the format:

data "alicloud.ecs.getDisks" "disks_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
Type string

Disk type. Possible values: system and data.

category string

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

encrypted string

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

ids string[]

A list of disks IDs.

instanceId string

Filter the results by the specified ECS instance ID.

nameRegex string

A regex string to filter results by disk name.

outputFile string
resourceGroupId string

The Id of resource group which the disk belongs.

tags {[key: string]: any}

A map of tags assigned to the disks. It must be in the format:

data "alicloud.ecs.getDisks" "disks_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
type string

Disk type. Possible values: system and data.

category str

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

encrypted str

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

ids List[str]

A list of disks IDs.

instance_id str

Filter the results by the specified ECS instance ID.

name_regex str

A regex string to filter results by disk name.

output_file str
resource_group_id str

The Id of resource group which the disk belongs.

tags Dict[str, Any]

A map of tags assigned to the disks. It must be in the format:

data "alicloud.ecs.getDisks" "disks_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
type str

Disk type. Possible values: system and data.

GetDisks Result

The following output properties are available:

Disks List<Pulumi.AliCloud.Ecs.Outputs.GetDisksDisk>

A list of disks. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Category string

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

Encrypted string

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

InstanceId string

ID of the related instance. It is null unless the status is In_use.

NameRegex string
OutputFile string
ResourceGroupId string

The Id of resource group.

Tags Dictionary<string, object>

A map of tags assigned to the disk.

Type string

Disk type. Possible values: system and data.

Disks []GetDisksDisk

A list of disks. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Category string

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

Encrypted string

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

InstanceId string

ID of the related instance. It is null unless the status is In_use.

NameRegex string
OutputFile string
ResourceGroupId string

The Id of resource group.

Tags map[string]interface{}

A map of tags assigned to the disk.

Type string

Disk type. Possible values: system and data.

disks GetDisksDisk[]

A list of disks. Each element contains the following attributes:

id string

The provider-assigned unique ID for this managed resource.

ids string[]
category string

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

encrypted string

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

instanceId string

ID of the related instance. It is null unless the status is In_use.

nameRegex string
outputFile string
resourceGroupId string

The Id of resource group.

tags {[key: string]: any}

A map of tags assigned to the disk.

type string

Disk type. Possible values: system and data.

disks List[GetDisksDisk]

A list of disks. Each element contains the following attributes:

id str

The provider-assigned unique ID for this managed resource.

ids List[str]
category str

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

encrypted str

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

instance_id str

ID of the related instance. It is null unless the status is In_use.

name_regex str
output_file str
resource_group_id str

The Id of resource group.

tags Dict[str, Any]

A map of tags assigned to the disk.

type str

Disk type. Possible values: system and data.

Supporting Types

GetDisksDisk

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

AttachedTime string

Disk attachment time.

AvailabilityZone string

Availability zone of the disk.

Category string

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

CreationTime string

Disk creation time.

Description string

Disk description.

DetachedTime string

Disk detachment time.

Encrypted string

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

ExpirationTime string

Disk expiration time.

Id string

ID of the disk.

ImageId string

ID of the image from which the disk is created. It is null unless the disk is created using an image.

InstanceId string

Filter the results by the specified ECS instance ID.

Name string

Disk name.

RegionId string

Region ID the disk belongs to.

ResourceGroupId string

The Id of resource group which the disk belongs.

Size int

Disk size in GiB.

SnapshotId string

Snapshot used to create the disk. It is null if no snapshot is used to create the disk.

Status string

Current status. Possible values: In_use, Available, Attaching, Detaching, Creating and ReIniting.

Type string

Disk type. Possible values: system and data.

Tags Dictionary<string, object>

A map of tags assigned to the disks. It must be in the format:

data "alicloud.ecs.getDisks" "disks_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
AttachedTime string

Disk attachment time.

AvailabilityZone string

Availability zone of the disk.

Category string

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

CreationTime string

Disk creation time.

Description string

Disk description.

DetachedTime string

Disk detachment time.

Encrypted string

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

ExpirationTime string

Disk expiration time.

Id string

ID of the disk.

ImageId string

ID of the image from which the disk is created. It is null unless the disk is created using an image.

InstanceId string

Filter the results by the specified ECS instance ID.

Name string

Disk name.

RegionId string

Region ID the disk belongs to.

ResourceGroupId string

The Id of resource group which the disk belongs.

Size int

Disk size in GiB.

SnapshotId string

Snapshot used to create the disk. It is null if no snapshot is used to create the disk.

Status string

Current status. Possible values: In_use, Available, Attaching, Detaching, Creating and ReIniting.

Type string

Disk type. Possible values: system and data.

Tags map[string]interface{}

A map of tags assigned to the disks. It must be in the format:

data "alicloud.ecs.getDisks" "disks_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
attachedTime string

Disk attachment time.

availabilityZone string

Availability zone of the disk.

category string

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

creationTime string

Disk creation time.

description string

Disk description.

detachedTime string

Disk detachment time.

encrypted string

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

expirationTime string

Disk expiration time.

id string

ID of the disk.

imageId string

ID of the image from which the disk is created. It is null unless the disk is created using an image.

instanceId string

Filter the results by the specified ECS instance ID.

name string

Disk name.

regionId string

Region ID the disk belongs to.

resourceGroupId string

The Id of resource group which the disk belongs.

size number

Disk size in GiB.

snapshotId string

Snapshot used to create the disk. It is null if no snapshot is used to create the disk.

status string

Current status. Possible values: In_use, Available, Attaching, Detaching, Creating and ReIniting.

type string

Disk type. Possible values: system and data.

tags {[key: string]: any}

A map of tags assigned to the disks. It must be in the format:

data "alicloud.ecs.getDisks" "disks_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
attachedTime str

Disk attachment time.

availability_zone str

Availability zone of the disk.

category str

Disk category. Possible values: cloud (basic cloud disk), cloud_efficiency (ultra cloud disk), ephemeral_ssd (local SSD cloud disk), cloud_ssd (SSD cloud disk), and cloud_essd (ESSD cloud disk).

creation_time str

Disk creation time.

description str

Disk description.

detachedTime str

Disk detachment time.

encrypted str

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

expirationTime str

Disk expiration time.

id str

ID of the disk.

image_id str

ID of the image from which the disk is created. It is null unless the disk is created using an image.

instance_id str

Filter the results by the specified ECS instance ID.

name str

Disk name.

regionId str

Region ID the disk belongs to.

resource_group_id str

The Id of resource group which the disk belongs.

size float

Disk size in GiB.

snapshot_id str

Snapshot used to create the disk. It is null if no snapshot is used to create the disk.

status str

Current status. Possible values: In_use, Available, Attaching, Detaching, Creating and ReIniting.

type str

Disk type. Possible values: system and data.

tags Dict[str, Any]

A map of tags assigned to the disks. It must be in the format:

data "alicloud.ecs.getDisks" "disks_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.