1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. simpleapplicationserver
  5. getServerDisks
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.simpleapplicationserver.getServerDisks

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

This data source provides the Simple Application Server Disks of the current Alibaba Cloud user.

NOTE: Available in v1.143.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.simpleapplicationserver.getServerDisks({
    ids: ["example_id"],
});
export const simpleApplicationServerDiskId1 = ids.then(ids => ids.disks?.[0]?.id);
const nameRegex = alicloud.simpleapplicationserver.getServerDisks({
    nameRegex: "^my-Disk",
});
export const simpleApplicationServerDiskId2 = nameRegex.then(nameRegex => nameRegex.disks?.[0]?.id);
const status = alicloud.simpleapplicationserver.getServerDisks({
    status: "In_use",
});
export const simpleApplicationServerDiskId3 = status.then(status => status.disks?.[0]?.id);
const instanceId = alicloud.simpleapplicationserver.getServerDisks({
    instanceId: "example_value",
});
export const simpleApplicationServerDiskId4 = instanceId.then(instanceId => instanceId.disks?.[0]?.id);
const diskType = alicloud.simpleapplicationserver.getServerDisks({
    diskType: "System",
});
export const simpleApplicationServerDiskId5 = diskType.then(diskType => diskType.disks?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.simpleapplicationserver.get_server_disks(ids=["example_id"])
pulumi.export("simpleApplicationServerDiskId1", ids.disks[0].id)
name_regex = alicloud.simpleapplicationserver.get_server_disks(name_regex="^my-Disk")
pulumi.export("simpleApplicationServerDiskId2", name_regex.disks[0].id)
status = alicloud.simpleapplicationserver.get_server_disks(status="In_use")
pulumi.export("simpleApplicationServerDiskId3", status.disks[0].id)
instance_id = alicloud.simpleapplicationserver.get_server_disks(instance_id="example_value")
pulumi.export("simpleApplicationServerDiskId4", instance_id.disks[0].id)
disk_type = alicloud.simpleapplicationserver.get_server_disks(disk_type="System")
pulumi.export("simpleApplicationServerDiskId5", disk_type.disks[0].id)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/simpleapplicationserver"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := simpleapplicationserver.GetServerDisks(ctx, &simpleapplicationserver.GetServerDisksArgs{
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("simpleApplicationServerDiskId1", ids.Disks[0].Id)
		nameRegex, err := simpleapplicationserver.GetServerDisks(ctx, &simpleapplicationserver.GetServerDisksArgs{
			NameRegex: pulumi.StringRef("^my-Disk"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("simpleApplicationServerDiskId2", nameRegex.Disks[0].Id)
		status, err := simpleapplicationserver.GetServerDisks(ctx, &simpleapplicationserver.GetServerDisksArgs{
			Status: pulumi.StringRef("In_use"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("simpleApplicationServerDiskId3", status.Disks[0].Id)
		instanceId, err := simpleapplicationserver.GetServerDisks(ctx, &simpleapplicationserver.GetServerDisksArgs{
			InstanceId: pulumi.StringRef("example_value"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("simpleApplicationServerDiskId4", instanceId.Disks[0].Id)
		diskType, err := simpleapplicationserver.GetServerDisks(ctx, &simpleapplicationserver.GetServerDisksArgs{
			DiskType: pulumi.StringRef("System"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("simpleApplicationServerDiskId5", diskType.Disks[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var ids = AliCloud.SimpleApplicationServer.GetServerDisks.Invoke(new()
    {
        Ids = new[]
        {
            "example_id",
        },
    });

    var nameRegex = AliCloud.SimpleApplicationServer.GetServerDisks.Invoke(new()
    {
        NameRegex = "^my-Disk",
    });

    var status = AliCloud.SimpleApplicationServer.GetServerDisks.Invoke(new()
    {
        Status = "In_use",
    });

    var instanceId = AliCloud.SimpleApplicationServer.GetServerDisks.Invoke(new()
    {
        InstanceId = "example_value",
    });

    var diskType = AliCloud.SimpleApplicationServer.GetServerDisks.Invoke(new()
    {
        DiskType = "System",
    });

    return new Dictionary<string, object?>
    {
        ["simpleApplicationServerDiskId1"] = ids.Apply(getServerDisksResult => getServerDisksResult.Disks[0]?.Id),
        ["simpleApplicationServerDiskId2"] = nameRegex.Apply(getServerDisksResult => getServerDisksResult.Disks[0]?.Id),
        ["simpleApplicationServerDiskId3"] = status.Apply(getServerDisksResult => getServerDisksResult.Disks[0]?.Id),
        ["simpleApplicationServerDiskId4"] = instanceId.Apply(getServerDisksResult => getServerDisksResult.Disks[0]?.Id),
        ["simpleApplicationServerDiskId5"] = diskType.Apply(getServerDisksResult => getServerDisksResult.Disks[0]?.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.simpleapplicationserver.SimpleapplicationserverFunctions;
import com.pulumi.alicloud.simpleapplicationserver.inputs.GetServerDisksArgs;
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 ids = SimpleapplicationserverFunctions.getServerDisks(GetServerDisksArgs.builder()
            .ids("example_id")
            .build());

        ctx.export("simpleApplicationServerDiskId1", ids.applyValue(getServerDisksResult -> getServerDisksResult.disks()[0].id()));
        final var nameRegex = SimpleapplicationserverFunctions.getServerDisks(GetServerDisksArgs.builder()
            .nameRegex("^my-Disk")
            .build());

        ctx.export("simpleApplicationServerDiskId2", nameRegex.applyValue(getServerDisksResult -> getServerDisksResult.disks()[0].id()));
        final var status = SimpleapplicationserverFunctions.getServerDisks(GetServerDisksArgs.builder()
            .status("In_use")
            .build());

        ctx.export("simpleApplicationServerDiskId3", status.applyValue(getServerDisksResult -> getServerDisksResult.disks()[0].id()));
        final var instanceId = SimpleapplicationserverFunctions.getServerDisks(GetServerDisksArgs.builder()
            .instanceId("example_value")
            .build());

        ctx.export("simpleApplicationServerDiskId4", instanceId.applyValue(getServerDisksResult -> getServerDisksResult.disks()[0].id()));
        final var diskType = SimpleapplicationserverFunctions.getServerDisks(GetServerDisksArgs.builder()
            .diskType("System")
            .build());

        ctx.export("simpleApplicationServerDiskId5", diskType.applyValue(getServerDisksResult -> getServerDisksResult.disks()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:simpleapplicationserver:getServerDisks
      arguments:
        ids:
          - example_id
  nameRegex:
    fn::invoke:
      function: alicloud:simpleapplicationserver:getServerDisks
      arguments:
        nameRegex: ^my-Disk
  status:
    fn::invoke:
      function: alicloud:simpleapplicationserver:getServerDisks
      arguments:
        status: In_use
  instanceId:
    fn::invoke:
      function: alicloud:simpleapplicationserver:getServerDisks
      arguments:
        instanceId: example_value
  diskType:
    fn::invoke:
      function: alicloud:simpleapplicationserver:getServerDisks
      arguments:
        diskType: System
outputs:
  simpleApplicationServerDiskId1: ${ids.disks[0].id}
  simpleApplicationServerDiskId2: ${nameRegex.disks[0].id}
  simpleApplicationServerDiskId3: ${status.disks[0].id}
  simpleApplicationServerDiskId4: ${instanceId.disks[0].id}
  simpleApplicationServerDiskId5: ${diskType.disks[0].id}
Copy

Using getServerDisks

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 getServerDisks(args: GetServerDisksArgs, opts?: InvokeOptions): Promise<GetServerDisksResult>
function getServerDisksOutput(args: GetServerDisksOutputArgs, opts?: InvokeOptions): Output<GetServerDisksResult>
Copy
def get_server_disks(disk_type: Optional[str] = None,
                     ids: Optional[Sequence[str]] = None,
                     instance_id: Optional[str] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     status: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetServerDisksResult
def get_server_disks_output(disk_type: Optional[pulumi.Input[str]] = None,
                     ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     instance_id: Optional[pulumi.Input[str]] = None,
                     name_regex: Optional[pulumi.Input[str]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     status: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetServerDisksResult]
Copy
func GetServerDisks(ctx *Context, args *GetServerDisksArgs, opts ...InvokeOption) (*GetServerDisksResult, error)
func GetServerDisksOutput(ctx *Context, args *GetServerDisksOutputArgs, opts ...InvokeOption) GetServerDisksResultOutput
Copy

> Note: This function is named GetServerDisks in the Go SDK.

public static class GetServerDisks 
{
    public static Task<GetServerDisksResult> InvokeAsync(GetServerDisksArgs args, InvokeOptions? opts = null)
    public static Output<GetServerDisksResult> Invoke(GetServerDisksInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetServerDisksResult> getServerDisks(GetServerDisksArgs args, InvokeOptions options)
public static Output<GetServerDisksResult> getServerDisks(GetServerDisksArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:simpleapplicationserver/getServerDisks:getServerDisks
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

DiskType Changes to this property will trigger replacement. string
The type of the disk. Possible values: System, Data.
Ids Changes to this property will trigger replacement. List<string>
A list of Disk IDs.
InstanceId Changes to this property will trigger replacement. string
The ID of the simple application server to which the disk is attached.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Disk name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
DiskType Changes to this property will trigger replacement. string
The type of the disk. Possible values: System, Data.
Ids Changes to this property will trigger replacement. []string
A list of Disk IDs.
InstanceId Changes to this property will trigger replacement. string
The ID of the simple application server to which the disk is attached.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Disk name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
diskType Changes to this property will trigger replacement. String
The type of the disk. Possible values: System, Data.
ids Changes to this property will trigger replacement. List<String>
A list of Disk IDs.
instanceId Changes to this property will trigger replacement. String
The ID of the simple application server to which the disk is attached.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Disk name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
diskType Changes to this property will trigger replacement. string
The type of the disk. Possible values: System, Data.
ids Changes to this property will trigger replacement. string[]
A list of Disk IDs.
instanceId Changes to this property will trigger replacement. string
The ID of the simple application server to which the disk is attached.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Disk name.
outputFile string
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. string
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
disk_type Changes to this property will trigger replacement. str
The type of the disk. Possible values: System, Data.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Disk IDs.
instance_id Changes to this property will trigger replacement. str
The ID of the simple application server to which the disk is attached.
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Disk name.
output_file str
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. str
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
diskType Changes to this property will trigger replacement. String
The type of the disk. Possible values: System, Data.
ids Changes to this property will trigger replacement. List<String>
A list of Disk IDs.
instanceId Changes to this property will trigger replacement. String
The ID of the simple application server to which the disk is attached.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Disk name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.

getServerDisks Result

The following output properties are available:

Disks List<Pulumi.AliCloud.SimpleApplicationServer.Outputs.GetServerDisksDisk>
Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Names List<string>
DiskType string
InstanceId string
NameRegex string
OutputFile string
Status string
Disks []GetServerDisksDisk
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
DiskType string
InstanceId string
NameRegex string
OutputFile string
Status string
disks List<GetServerDisksDisk>
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
diskType String
instanceId String
nameRegex String
outputFile String
status String
disks GetServerDisksDisk[]
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
diskType string
instanceId string
nameRegex string
outputFile string
status string
disks Sequence[GetServerDisksDisk]
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
disk_type str
instance_id str
name_regex str
output_file str
status str
disks List<Property Map>
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
diskType String
instanceId String
nameRegex String
outputFile String
status String

Supporting Types

GetServerDisksDisk

Category This property is required. string
Disk type. Possible values: ESSD, SSD.
CreateTime This property is required. string
The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
Device This property is required. string
The device name of the disk on the simple application server.
DiskId This property is required. string
The first ID of the resource.
DiskName This property is required. string
The name of the resource.
DiskType This property is required. string
The type of the disk. Possible values: System, Data.
Id This property is required. string
The ID of the Disk.
InstanceId This property is required. string
Alibaba Cloud simple application server instance ID.
PaymentType This property is required. string
The payment type of the resource. Valid values: PayAsYouGo, Subscription.
Size This property is required. int
The size of the disk. Unit: GB.
Status This property is required. string
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
Category This property is required. string
Disk type. Possible values: ESSD, SSD.
CreateTime This property is required. string
The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
Device This property is required. string
The device name of the disk on the simple application server.
DiskId This property is required. string
The first ID of the resource.
DiskName This property is required. string
The name of the resource.
DiskType This property is required. string
The type of the disk. Possible values: System, Data.
Id This property is required. string
The ID of the Disk.
InstanceId This property is required. string
Alibaba Cloud simple application server instance ID.
PaymentType This property is required. string
The payment type of the resource. Valid values: PayAsYouGo, Subscription.
Size This property is required. int
The size of the disk. Unit: GB.
Status This property is required. string
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
category This property is required. String
Disk type. Possible values: ESSD, SSD.
createTime This property is required. String
The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
device This property is required. String
The device name of the disk on the simple application server.
diskId This property is required. String
The first ID of the resource.
diskName This property is required. String
The name of the resource.
diskType This property is required. String
The type of the disk. Possible values: System, Data.
id This property is required. String
The ID of the Disk.
instanceId This property is required. String
Alibaba Cloud simple application server instance ID.
paymentType This property is required. String
The payment type of the resource. Valid values: PayAsYouGo, Subscription.
size This property is required. Integer
The size of the disk. Unit: GB.
status This property is required. String
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
category This property is required. string
Disk type. Possible values: ESSD, SSD.
createTime This property is required. string
The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
device This property is required. string
The device name of the disk on the simple application server.
diskId This property is required. string
The first ID of the resource.
diskName This property is required. string
The name of the resource.
diskType This property is required. string
The type of the disk. Possible values: System, Data.
id This property is required. string
The ID of the Disk.
instanceId This property is required. string
Alibaba Cloud simple application server instance ID.
paymentType This property is required. string
The payment type of the resource. Valid values: PayAsYouGo, Subscription.
size This property is required. number
The size of the disk. Unit: GB.
status This property is required. string
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
category This property is required. str
Disk type. Possible values: ESSD, SSD.
create_time This property is required. str
The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
device This property is required. str
The device name of the disk on the simple application server.
disk_id This property is required. str
The first ID of the resource.
disk_name This property is required. str
The name of the resource.
disk_type This property is required. str
The type of the disk. Possible values: System, Data.
id This property is required. str
The ID of the Disk.
instance_id This property is required. str
Alibaba Cloud simple application server instance ID.
payment_type This property is required. str
The payment type of the resource. Valid values: PayAsYouGo, Subscription.
size This property is required. int
The size of the disk. Unit: GB.
status This property is required. str
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
category This property is required. String
Disk type. Possible values: ESSD, SSD.
createTime This property is required. String
The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
device This property is required. String
The device name of the disk on the simple application server.
diskId This property is required. String
The first ID of the resource.
diskName This property is required. String
The name of the resource.
diskType This property is required. String
The type of the disk. Possible values: System, Data.
id This property is required. String
The ID of the Disk.
instanceId This property is required. String
Alibaba Cloud simple application server instance ID.
paymentType This property is required. String
The payment type of the resource. Valid values: PayAsYouGo, Subscription.
size This property is required. Number
The size of the disk. Unit: GB.
status This property is required. String
The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi