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

alicloud.databasefilesystem.getInstances

Explore with Pulumi AI

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

This data source provides the DBFS Instances of the current Alibaba Cloud user.

NOTE: Available in v1.136.0+.

Example Usage

Basic Usage

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

const ids = alicloud.databasefilesystem.getInstances({
    ids: ["example_id"],
});
export const dbfsInstanceId1 = ids.then(ids => ids.instances?.[0]?.id);
const nameRegex = alicloud.databasefilesystem.getInstances({
    nameRegex: "^my-Instance",
});
export const dbfsInstanceId2 = nameRegex.then(nameRegex => nameRegex.instances?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.databasefilesystem.get_instances(ids=["example_id"])
pulumi.export("dbfsInstanceId1", ids.instances[0].id)
name_regex = alicloud.databasefilesystem.get_instances(name_regex="^my-Instance")
pulumi.export("dbfsInstanceId2", name_regex.instances[0].id)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := databasefilesystem.GetInstances(ctx, &databasefilesystem.GetInstancesArgs{
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("dbfsInstanceId1", ids.Instances[0].Id)
		nameRegex, err := databasefilesystem.GetInstances(ctx, &databasefilesystem.GetInstancesArgs{
			NameRegex: pulumi.StringRef("^my-Instance"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("dbfsInstanceId2", nameRegex.Instances[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.DatabaseFilesystem.GetInstances.Invoke(new()
    {
        Ids = new[]
        {
            "example_id",
        },
    });

    var nameRegex = AliCloud.DatabaseFilesystem.GetInstances.Invoke(new()
    {
        NameRegex = "^my-Instance",
    });

    return new Dictionary<string, object?>
    {
        ["dbfsInstanceId1"] = ids.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
        ["dbfsInstanceId2"] = nameRegex.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.databasefilesystem.DatabasefilesystemFunctions;
import com.pulumi.alicloud.databasefilesystem.inputs.GetInstancesArgs;
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 = DatabasefilesystemFunctions.getInstances(GetInstancesArgs.builder()
            .ids("example_id")
            .build());

        ctx.export("dbfsInstanceId1", ids.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
        final var nameRegex = DatabasefilesystemFunctions.getInstances(GetInstancesArgs.builder()
            .nameRegex("^my-Instance")
            .build());

        ctx.export("dbfsInstanceId2", nameRegex.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:databasefilesystem:getInstances
      arguments:
        ids:
          - example_id
  nameRegex:
    fn::invoke:
      function: alicloud:databasefilesystem:getInstances
      arguments:
        nameRegex: ^my-Instance
outputs:
  dbfsInstanceId1: ${ids.instances[0].id}
  dbfsInstanceId2: ${nameRegex.instances[0].id}
Copy

Using getInstances

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 getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>
Copy
def get_instances(ids: Optional[Sequence[str]] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  status: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(ids: Optional[pulumi.Input[Sequence[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[GetInstancesResult]
Copy
func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput
Copy

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

public static class GetInstances 
{
    public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
    public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
public static Output<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:databasefilesystem/getInstances:getInstances
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of Instance IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Instance name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
Database file system state. Valid values: attached, attaching, creating, deleted, deleting, detaching, resizing, snapshotting, unattached, upgrading.
Ids Changes to this property will trigger replacement. []string
A list of Instance IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Instance name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
Database file system state. Valid values: attached, attaching, creating, deleted, deleting, detaching, resizing, snapshotting, unattached, upgrading.
ids Changes to this property will trigger replacement. List<String>
A list of Instance IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Instance name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
Database file system state. Valid values: attached, attaching, creating, deleted, deleting, detaching, resizing, snapshotting, unattached, upgrading.
ids Changes to this property will trigger replacement. string[]
A list of Instance IDs.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Instance name.
outputFile string
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. string
Database file system state. Valid values: attached, attaching, creating, deleted, deleting, detaching, resizing, snapshotting, unattached, upgrading.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Instance IDs.
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Instance 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
Database file system state. Valid values: attached, attaching, creating, deleted, deleting, detaching, resizing, snapshotting, unattached, upgrading.
ids Changes to this property will trigger replacement. List<String>
A list of Instance IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Instance name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
Database file system state. Valid values: attached, attaching, creating, deleted, deleting, detaching, resizing, snapshotting, unattached, upgrading.

getInstances Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Instances List<Pulumi.AliCloud.DatabaseFilesystem.Outputs.GetInstancesInstance>
Names List<string>
NameRegex string
OutputFile string
Status string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Instances []GetInstancesInstance
Names []string
NameRegex string
OutputFile string
Status string
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
instances List<GetInstancesInstance>
names List<String>
nameRegex String
outputFile String
status String
id string
The provider-assigned unique ID for this managed resource.
ids string[]
instances GetInstancesInstance[]
names string[]
nameRegex string
outputFile string
status string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
instances Sequence[GetInstancesInstance]
names Sequence[str]
name_regex str
output_file str
status str
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
instances List<Property Map>
names List<String>
nameRegex String
outputFile String
status String

Supporting Types

GetInstancesInstance

AttachNodeNumber This property is required. int
the number of nodes of the Database file system.
Category This property is required. string
The type of the Database file system. Valid values: standard.
CreateTime This property is required. string
The create time of the Database file system.
DbfsClusterId This property is required. string
The cluster ID of the Database file system.
EcsLists This property is required. List<Pulumi.AliCloud.DatabaseFilesystem.Inputs.GetInstancesInstanceEcsList>
The collection of ECS instances mounted to the Database file system.
EnableRaid This property is required. bool
Whether to create the Database file system in RAID way. Valid values : true anf false.
Encryption This property is required. bool
Whether to encrypt the Database file system. Valid values: true and false.
Id This property is required. string
The ID of the Instance.
InstanceId This property is required. string
The ID of the Database File System
InstanceName This property is required. string
The name of the Database file system.
KmsKeyId This property is required. string
The KMS key ID of the Database file system used. This parameter is valid When encryption parameter is set to true.
PaymentType This property is required. string
Thr payment type of the Database file system. Valid value: PayAsYouGo.
PerformanceLevel This property is required. string
The performance level of the Database file system. Valid values: PL0, PL1, PL2, PL3.
RaidStripeUnitNumber This property is required. string
The number of strip . When enable_raid parameter is set to true will transfer. This parameter is valid When enable_raid parameter is set to true.
Size This property is required. int
The size Of the Database file system. Unit: GiB.
Status This property is required. string
The status of the Database file system.
ZoneId This property is required. string
The Zone ID of the Database file system.
AttachNodeNumber This property is required. int
the number of nodes of the Database file system.
Category This property is required. string
The type of the Database file system. Valid values: standard.
CreateTime This property is required. string
The create time of the Database file system.
DbfsClusterId This property is required. string
The cluster ID of the Database file system.
EcsLists This property is required. []GetInstancesInstanceEcsList
The collection of ECS instances mounted to the Database file system.
EnableRaid This property is required. bool
Whether to create the Database file system in RAID way. Valid values : true anf false.
Encryption This property is required. bool
Whether to encrypt the Database file system. Valid values: true and false.
Id This property is required. string
The ID of the Instance.
InstanceId This property is required. string
The ID of the Database File System
InstanceName This property is required. string
The name of the Database file system.
KmsKeyId This property is required. string
The KMS key ID of the Database file system used. This parameter is valid When encryption parameter is set to true.
PaymentType This property is required. string
Thr payment type of the Database file system. Valid value: PayAsYouGo.
PerformanceLevel This property is required. string
The performance level of the Database file system. Valid values: PL0, PL1, PL2, PL3.
RaidStripeUnitNumber This property is required. string
The number of strip . When enable_raid parameter is set to true will transfer. This parameter is valid When enable_raid parameter is set to true.
Size This property is required. int
The size Of the Database file system. Unit: GiB.
Status This property is required. string
The status of the Database file system.
ZoneId This property is required. string
The Zone ID of the Database file system.
attachNodeNumber This property is required. Integer
the number of nodes of the Database file system.
category This property is required. String
The type of the Database file system. Valid values: standard.
createTime This property is required. String
The create time of the Database file system.
dbfsClusterId This property is required. String
The cluster ID of the Database file system.
ecsLists This property is required. List<GetInstancesInstanceEcsList>
The collection of ECS instances mounted to the Database file system.
enableRaid This property is required. Boolean
Whether to create the Database file system in RAID way. Valid values : true anf false.
encryption This property is required. Boolean
Whether to encrypt the Database file system. Valid values: true and false.
id This property is required. String
The ID of the Instance.
instanceId This property is required. String
The ID of the Database File System
instanceName This property is required. String
The name of the Database file system.
kmsKeyId This property is required. String
The KMS key ID of the Database file system used. This parameter is valid When encryption parameter is set to true.
paymentType This property is required. String
Thr payment type of the Database file system. Valid value: PayAsYouGo.
performanceLevel This property is required. String
The performance level of the Database file system. Valid values: PL0, PL1, PL2, PL3.
raidStripeUnitNumber This property is required. String
The number of strip . When enable_raid parameter is set to true will transfer. This parameter is valid When enable_raid parameter is set to true.
size This property is required. Integer
The size Of the Database file system. Unit: GiB.
status This property is required. String
The status of the Database file system.
zoneId This property is required. String
The Zone ID of the Database file system.
attachNodeNumber This property is required. number
the number of nodes of the Database file system.
category This property is required. string
The type of the Database file system. Valid values: standard.
createTime This property is required. string
The create time of the Database file system.
dbfsClusterId This property is required. string
The cluster ID of the Database file system.
ecsLists This property is required. GetInstancesInstanceEcsList[]
The collection of ECS instances mounted to the Database file system.
enableRaid This property is required. boolean
Whether to create the Database file system in RAID way. Valid values : true anf false.
encryption This property is required. boolean
Whether to encrypt the Database file system. Valid values: true and false.
id This property is required. string
The ID of the Instance.
instanceId This property is required. string
The ID of the Database File System
instanceName This property is required. string
The name of the Database file system.
kmsKeyId This property is required. string
The KMS key ID of the Database file system used. This parameter is valid When encryption parameter is set to true.
paymentType This property is required. string
Thr payment type of the Database file system. Valid value: PayAsYouGo.
performanceLevel This property is required. string
The performance level of the Database file system. Valid values: PL0, PL1, PL2, PL3.
raidStripeUnitNumber This property is required. string
The number of strip . When enable_raid parameter is set to true will transfer. This parameter is valid When enable_raid parameter is set to true.
size This property is required. number
The size Of the Database file system. Unit: GiB.
status This property is required. string
The status of the Database file system.
zoneId This property is required. string
The Zone ID of the Database file system.
attach_node_number This property is required. int
the number of nodes of the Database file system.
category This property is required. str
The type of the Database file system. Valid values: standard.
create_time This property is required. str
The create time of the Database file system.
dbfs_cluster_id This property is required. str
The cluster ID of the Database file system.
ecs_lists This property is required. Sequence[GetInstancesInstanceEcsList]
The collection of ECS instances mounted to the Database file system.
enable_raid This property is required. bool
Whether to create the Database file system in RAID way. Valid values : true anf false.
encryption This property is required. bool
Whether to encrypt the Database file system. Valid values: true and false.
id This property is required. str
The ID of the Instance.
instance_id This property is required. str
The ID of the Database File System
instance_name This property is required. str
The name of the Database file system.
kms_key_id This property is required. str
The KMS key ID of the Database file system used. This parameter is valid When encryption parameter is set to true.
payment_type This property is required. str
Thr payment type of the Database file system. Valid value: PayAsYouGo.
performance_level This property is required. str
The performance level of the Database file system. Valid values: PL0, PL1, PL2, PL3.
raid_stripe_unit_number This property is required. str
The number of strip . When enable_raid parameter is set to true will transfer. This parameter is valid When enable_raid parameter is set to true.
size This property is required. int
The size Of the Database file system. Unit: GiB.
status This property is required. str
The status of the Database file system.
zone_id This property is required. str
The Zone ID of the Database file system.
attachNodeNumber This property is required. Number
the number of nodes of the Database file system.
category This property is required. String
The type of the Database file system. Valid values: standard.
createTime This property is required. String
The create time of the Database file system.
dbfsClusterId This property is required. String
The cluster ID of the Database file system.
ecsLists This property is required. List<Property Map>
The collection of ECS instances mounted to the Database file system.
enableRaid This property is required. Boolean
Whether to create the Database file system in RAID way. Valid values : true anf false.
encryption This property is required. Boolean
Whether to encrypt the Database file system. Valid values: true and false.
id This property is required. String
The ID of the Instance.
instanceId This property is required. String
The ID of the Database File System
instanceName This property is required. String
The name of the Database file system.
kmsKeyId This property is required. String
The KMS key ID of the Database file system used. This parameter is valid When encryption parameter is set to true.
paymentType This property is required. String
Thr payment type of the Database file system. Valid value: PayAsYouGo.
performanceLevel This property is required. String
The performance level of the Database file system. Valid values: PL0, PL1, PL2, PL3.
raidStripeUnitNumber This property is required. String
The number of strip . When enable_raid parameter is set to true will transfer. This parameter is valid When enable_raid parameter is set to true.
size This property is required. Number
The size Of the Database file system. Unit: GiB.
status This property is required. String
The status of the Database file system.
zoneId This property is required. String
The Zone ID of the Database file system.

GetInstancesInstanceEcsList

EcsId This property is required. string
The ID of the ECS instance.
EcsId This property is required. string
The ID of the ECS instance.
ecsId This property is required. String
The ID of the ECS instance.
ecsId This property is required. string
The ID of the ECS instance.
ecs_id This property is required. str
The ID of the ECS instance.
ecsId This property is required. String
The ID of the ECS instance.

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