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), andcloud_essd(ESSD cloud disk).- Encrypted string
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- Ids List<string>
A list of disks IDs.
- Instance
Id string Filter the results by the specified ECS instance ID.
- Name
Regex string A regex string to filter results by disk name.
- Output
File string - Resource
Group stringId The Id of resource group which the disk belongs.
- 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:
systemanddata.
- 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), andcloud_essd(ESSD cloud disk).- Encrypted string
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- Ids []string
A list of disks IDs.
- Instance
Id string Filter the results by the specified ECS instance ID.
- Name
Regex string A regex string to filter results by disk name.
- Output
File string - Resource
Group stringId The Id of resource group which the disk belongs.
- 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:
systemanddata.
- 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), andcloud_essd(ESSD cloud disk).- encrypted string
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- ids string[]
A list of disks IDs.
- instance
Id string Filter the results by the specified ECS instance ID.
- name
Regex string A regex string to filter results by disk name.
- output
File string - resource
Group stringId The Id of resource group which the disk belongs.
- {[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:
systemanddata.
- 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), andcloud_essd(ESSD cloud disk).- encrypted str
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- 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_ strid The Id of resource group which the disk belongs.
- 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:
systemanddata.
GetDisks Result
The following output properties are available:
- Disks
List<Pulumi.
Ali Cloud. Ecs. Outputs. Get Disks Disk> 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), andcloud_essd(ESSD cloud disk).- Encrypted string
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- Instance
Id string ID of the related instance. It is
nullunless thestatusisIn_use.- Name
Regex string - Output
File string - Resource
Group stringId The Id of resource group.
- Dictionary<string, object>
A map of tags assigned to the disk.
- Type string
Disk type. Possible values:
systemanddata.
- Disks
[]Get
Disks Disk 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), andcloud_essd(ESSD cloud disk).- Encrypted string
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- Instance
Id string ID of the related instance. It is
nullunless thestatusisIn_use.- Name
Regex string - Output
File string - Resource
Group stringId The Id of resource group.
- map[string]interface{}
A map of tags assigned to the disk.
- Type string
Disk type. Possible values:
systemanddata.
- disks
Get
Disks Disk[] 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), andcloud_essd(ESSD cloud disk).- encrypted string
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- instance
Id string ID of the related instance. It is
nullunless thestatusisIn_use.- name
Regex string - output
File string - resource
Group stringId The Id of resource group.
- {[key: string]: any}
A map of tags assigned to the disk.
- type string
Disk type. Possible values:
systemanddata.
- disks
List[Get
Disks Disk] 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), andcloud_essd(ESSD cloud disk).- encrypted str
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- instance_
id str ID of the related instance. It is
nullunless thestatusisIn_use.- name_
regex str - output_
file str - resource_
group_ strid The Id of resource group.
- Dict[str, Any]
A map of tags assigned to the disk.
- type str
Disk type. Possible values:
systemanddata.
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.
- Attached
Time string Disk attachment time.
- Availability
Zone 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), andcloud_essd(ESSD cloud disk).- Creation
Time string Disk creation time.
- Description string
Disk description.
- Detached
Time string Disk detachment time.
- Encrypted string
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- Expiration
Time string Disk expiration time.
- Id string
ID of the disk.
- Image
Id string ID of the image from which the disk is created. It is null unless the disk is created using an image.
- Instance
Id string Filter the results by the specified ECS instance ID.
- Name string
Disk name.
- Region
Id string Region ID the disk belongs to.
- Resource
Group stringId The Id of resource group which the disk belongs.
- Size int
Disk size in GiB.
- Snapshot
Id 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,CreatingandReIniting.- Type string
Disk type. Possible values:
systemanddata.- 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" } }
- Attached
Time string Disk attachment time.
- Availability
Zone 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), andcloud_essd(ESSD cloud disk).- Creation
Time string Disk creation time.
- Description string
Disk description.
- Detached
Time string Disk detachment time.
- Encrypted string
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- Expiration
Time string Disk expiration time.
- Id string
ID of the disk.
- Image
Id string ID of the image from which the disk is created. It is null unless the disk is created using an image.
- Instance
Id string Filter the results by the specified ECS instance ID.
- Name string
Disk name.
- Region
Id string Region ID the disk belongs to.
- Resource
Group stringId The Id of resource group which the disk belongs.
- Size int
Disk size in GiB.
- Snapshot
Id 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,CreatingandReIniting.- Type string
Disk type. Possible values:
systemanddata.- 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" } }
- attached
Time string Disk attachment time.
- availability
Zone 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), andcloud_essd(ESSD cloud disk).- creation
Time string Disk creation time.
- description string
Disk description.
- detached
Time string Disk detachment time.
- encrypted string
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- expiration
Time string Disk expiration time.
- id string
ID of the disk.
- image
Id string ID of the image from which the disk is created. It is null unless the disk is created using an image.
- instance
Id string Filter the results by the specified ECS instance ID.
- name string
Disk name.
- region
Id string Region ID the disk belongs to.
- resource
Group stringId The Id of resource group which the disk belongs.
- size number
Disk size in GiB.
- snapshot
Id 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,CreatingandReIniting.- type string
Disk type. Possible values:
systemanddata.- {[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" } }
- attached
Time 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), andcloud_essd(ESSD cloud disk).- creation_
time str Disk creation time.
- description str
Disk description.
- detached
Time str Disk detachment time.
- encrypted str
Indicate whether the disk is encrypted or not. Possible values:
onandoff.- expiration
Time 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.
- region
Id str Region ID the disk belongs to.
- resource_
group_ strid 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,CreatingandReIniting.- type str
Disk type. Possible values:
systemanddata.- 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
alicloudTerraform Provider.