ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud
ucloud.getDisks
Explore with Pulumi AI
This data source provides a list of Disk resources according to their Disk ID and disk type.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ucloud from "@pulumi/ucloud";
const example = ucloud.getDisks({});
export const first = example.then(example => example.disks?.[0]?.id);
import pulumi
import pulumi_ucloud as ucloud
example = ucloud.get_disks()
pulumi.export("first", example.disks[0].id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ucloud.GetDisks(ctx, &ucloud.GetDisksArgs{}, nil)
if err != nil {
return err
}
ctx.Export("first", example.Disks[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ucloud = Pulumi.Ucloud;
return await Deployment.RunAsync(() =>
{
var example = Ucloud.GetDisks.Invoke();
return new Dictionary<string, object?>
{
["first"] = example.Apply(getDisksResult => getDisksResult.Disks[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ucloud.UcloudFunctions;
import com.pulumi.ucloud.inputs.GetDisksArgs;
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 = UcloudFunctions.getDisks();
ctx.export("first", example.applyValue(getDisksResult -> getDisksResult.disks()[0].id()));
}
}
variables:
example:
fn::invoke:
function: ucloud:getDisks
arguments: {}
outputs:
first: ${example.disks[0].id}
Using getDisks
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDisks(args: GetDisksArgs, opts?: InvokeOptions): Promise<GetDisksResult>
function getDisksOutput(args: GetDisksOutputArgs, opts?: InvokeOptions): Output<GetDisksResult>
def get_disks(availability_zone: Optional[str] = None,
disk_type: Optional[str] = None,
id: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDisksResult
def get_disks_output(availability_zone: Optional[pulumi.Input[str]] = None,
disk_type: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDisksResult]
func GetDisks(ctx *Context, args *GetDisksArgs, opts ...InvokeOption) (*GetDisksResult, error)
func GetDisksOutput(ctx *Context, args *GetDisksOutputArgs, opts ...InvokeOption) GetDisksResultOutput
> Note: This function is named GetDisks
in the Go SDK.
public static class GetDisks
{
public static Task<GetDisksResult> InvokeAsync(GetDisksArgs args, InvokeOptions? opts = null)
public static Output<GetDisksResult> Invoke(GetDisksInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDisksResult> getDisks(GetDisksArgs args, InvokeOptions options)
public static Output<GetDisksResult> getDisks(GetDisksArgs args, InvokeOptions options)
fn::invoke:
function: ucloud:index/getDisks:getDisks
arguments:
# arguments dictionary
The following arguments are supported:
- Availability
Zone string - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- Disk
Type string - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - Id string
- The ID of Disk.
- Ids List<string>
- A list of Disk IDs, all the Disks belong to this region will be retrieved if the ID is
[]
. - Name
Regex string - A regex string to filter resulting disks by name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Availability
Zone string - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- Disk
Type string - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - Id string
- The ID of Disk.
- Ids []string
- A list of Disk IDs, all the Disks belong to this region will be retrieved if the ID is
[]
. - Name
Regex string - A regex string to filter resulting disks by name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- availability
Zone String - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- disk
Type String - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - id String
- The ID of Disk.
- ids List<String>
- A list of Disk IDs, all the Disks belong to this region will be retrieved if the ID is
[]
. - name
Regex String - A regex string to filter resulting disks by name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- availability
Zone string - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- disk
Type string - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - id string
- The ID of Disk.
- ids string[]
- A list of Disk IDs, all the Disks belong to this region will be retrieved if the ID is
[]
. - name
Regex string - A regex string to filter resulting disks by name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- availability_
zone str - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- disk_
type str - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - id str
- The ID of Disk.
- ids Sequence[str]
- A list of Disk IDs, all the Disks belong to this region will be retrieved if the ID is
[]
. - name_
regex str - A regex string to filter resulting disks by name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- availability
Zone String - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- disk
Type String - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - id String
- The ID of Disk.
- ids List<String>
- A list of Disk IDs, all the Disks belong to this region will be retrieved if the ID is
[]
. - name
Regex String - A regex string to filter resulting disks by name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getDisks Result
The following output properties are available:
- Disks
List<Get
Disks Disk> - It is a nested type which documented below.
- Id string
- The ID of Disk.
- Ids List<string>
- Total
Count double - Total number of Disks that satisfy the condition.
- Availability
Zone string - Availability zone where disk is located.
- Disk
Type string - The type of disk.
- Name
Regex string - Output
File string
- Disks
[]Get
Disks Disk - It is a nested type which documented below.
- Id string
- The ID of Disk.
- Ids []string
- Total
Count float64 - Total number of Disks that satisfy the condition.
- Availability
Zone string - Availability zone where disk is located.
- Disk
Type string - The type of disk.
- Name
Regex string - Output
File string
- disks
List<Get
Disks Disk> - It is a nested type which documented below.
- id String
- The ID of Disk.
- ids List<String>
- total
Count Double - Total number of Disks that satisfy the condition.
- availability
Zone String - Availability zone where disk is located.
- disk
Type String - The type of disk.
- name
Regex String - output
File String
- disks
Get
Disks Disk[] - It is a nested type which documented below.
- id string
- The ID of Disk.
- ids string[]
- total
Count number - Total number of Disks that satisfy the condition.
- availability
Zone string - Availability zone where disk is located.
- disk
Type string - The type of disk.
- name
Regex string - output
File string
- disks
Sequence[Get
Disks Disk] - It is a nested type which documented below.
- id str
- The ID of Disk.
- ids Sequence[str]
- total_
count float - Total number of Disks that satisfy the condition.
- availability_
zone str - Availability zone where disk is located.
- disk_
type str - The type of disk.
- name_
regex str - output_
file str
- disks List<Property Map>
- It is a nested type which documented below.
- id String
- The ID of Disk.
- ids List<String>
- total
Count Number - Total number of Disks that satisfy the condition.
- availability
Zone String - Availability zone where disk is located.
- disk
Type String - The type of disk.
- name
Regex String - output
File String
Supporting Types
GetDisksDisk
- Availability
Zone string - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- Charge
Type string - The charge type of disk. Possible values are:
year
as pay by year,month
as pay by month,dynamic
as pay by hour. - Create
Time string - The creation time of Disk, formatted in RFC3339 time string.
- Disk
Size double - The size of disk. Purchase the size of disk in GB.
- Disk
Type string - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - Expire
Time string - The expiration time of disk, formatted in RFC3339 time string.
- Id string
- The ID of Disk.
- Name string
- The name of Disk.
- Status string
- The status of disk. Possible values are:
Available
,InUse
,Detaching
,Initializating
,Failed
,Cloning
,Restoring
,RestoreFailed
. - Tag string
- A tag assigned to Disk.
- Availability
Zone string - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- Charge
Type string - The charge type of disk. Possible values are:
year
as pay by year,month
as pay by month,dynamic
as pay by hour. - Create
Time string - The creation time of Disk, formatted in RFC3339 time string.
- Disk
Size float64 - The size of disk. Purchase the size of disk in GB.
- Disk
Type string - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - Expire
Time string - The expiration time of disk, formatted in RFC3339 time string.
- Id string
- The ID of Disk.
- Name string
- The name of Disk.
- Status string
- The status of disk. Possible values are:
Available
,InUse
,Detaching
,Initializating
,Failed
,Cloning
,Restoring
,RestoreFailed
. - Tag string
- A tag assigned to Disk.
- availability
Zone String - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- charge
Type String - The charge type of disk. Possible values are:
year
as pay by year,month
as pay by month,dynamic
as pay by hour. - create
Time String - The creation time of Disk, formatted in RFC3339 time string.
- disk
Size Double - The size of disk. Purchase the size of disk in GB.
- disk
Type String - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - expire
Time String - The expiration time of disk, formatted in RFC3339 time string.
- id String
- The ID of Disk.
- name String
- The name of Disk.
- status String
- The status of disk. Possible values are:
Available
,InUse
,Detaching
,Initializating
,Failed
,Cloning
,Restoring
,RestoreFailed
. - tag String
- A tag assigned to Disk.
- availability
Zone string - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- charge
Type string - The charge type of disk. Possible values are:
year
as pay by year,month
as pay by month,dynamic
as pay by hour. - create
Time string - The creation time of Disk, formatted in RFC3339 time string.
- disk
Size number - The size of disk. Purchase the size of disk in GB.
- disk
Type string - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - expire
Time string - The expiration time of disk, formatted in RFC3339 time string.
- id string
- The ID of Disk.
- name string
- The name of Disk.
- status string
- The status of disk. Possible values are:
Available
,InUse
,Detaching
,Initializating
,Failed
,Cloning
,Restoring
,RestoreFailed
. - tag string
- A tag assigned to Disk.
- availability_
zone str - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- charge_
type str - The charge type of disk. Possible values are:
year
as pay by year,month
as pay by month,dynamic
as pay by hour. - create_
time str - The creation time of Disk, formatted in RFC3339 time string.
- disk_
size float - The size of disk. Purchase the size of disk in GB.
- disk_
type str - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - expire_
time str - The expiration time of disk, formatted in RFC3339 time string.
- id str
- The ID of Disk.
- name str
- The name of Disk.
- status str
- The status of disk. Possible values are:
Available
,InUse
,Detaching
,Initializating
,Failed
,Cloning
,Restoring
,RestoreFailed
. - tag str
- A tag assigned to Disk.
- availability
Zone String - Availability zone where Disk are located. Such as: "cn-bj2-02". You may refer to list of availability zone
- charge
Type String - The charge type of disk. Possible values are:
year
as pay by year,month
as pay by month,dynamic
as pay by hour. - create
Time String - The creation time of Disk, formatted in RFC3339 time string.
- disk
Size Number - The size of disk. Purchase the size of disk in GB.
- disk
Type String - The type of disk. Possible values are:
data_disk
as cloud disk,ssd_data_disk
as SSD cloud disk,system_disk
as system disk,ssd_system_disk
as SSD system disk,rssd_data_disk
as RDMA-SSD cloud disk. - expire
Time String - The expiration time of disk, formatted in RFC3339 time string.
- id String
- The ID of Disk.
- name String
- The name of Disk.
- status String
- The status of disk. Possible values are:
Available
,InUse
,Detaching
,Initializating
,Failed
,Cloning
,Restoring
,RestoreFailed
. - tag String
- A tag assigned to Disk.
Package Details
- Repository
- ucloud ucloud/terraform-provider-ucloud
- License
- Notes
- This Pulumi package is based on the
ucloud
Terraform Provider.