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

alicloud.ocean.getBaseInstances

Explore with Pulumi AI

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

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

NOTE: Available in v1.203.0+.

Example Usage

Basic Usage

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

const ids = alicloud.ocean.getBaseInstances({});
export const oceanBaseInstanceId1 = ids.then(ids => ids.instances?.[0]?.id);
const nameRegex = alicloud.ocean.getBaseInstances({
    nameRegex: "^my-Instance",
});
export const oceanBaseInstanceId2 = nameRegex.then(nameRegex => nameRegex.instances?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.ocean.get_base_instances()
pulumi.export("oceanBaseInstanceId1", ids.instances[0].id)
name_regex = alicloud.ocean.get_base_instances(name_regex="^my-Instance")
pulumi.export("oceanBaseInstanceId2", name_regex.instances[0].id)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := ocean.GetBaseInstances(ctx, &ocean.GetBaseInstancesArgs{}, nil)
		if err != nil {
			return err
		}
		ctx.Export("oceanBaseInstanceId1", ids.Instances[0].Id)
		nameRegex, err := ocean.GetBaseInstances(ctx, &ocean.GetBaseInstancesArgs{
			NameRegex: pulumi.StringRef("^my-Instance"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("oceanBaseInstanceId2", 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.Ocean.GetBaseInstances.Invoke();

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

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

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ocean.OceanFunctions;
import com.pulumi.alicloud.ocean.inputs.GetBaseInstancesArgs;
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 = OceanFunctions.getBaseInstances();

        ctx.export("oceanBaseInstanceId1", ids.applyValue(getBaseInstancesResult -> getBaseInstancesResult.instances()[0].id()));
        final var nameRegex = OceanFunctions.getBaseInstances(GetBaseInstancesArgs.builder()
            .nameRegex("^my-Instance")
            .build());

        ctx.export("oceanBaseInstanceId2", nameRegex.applyValue(getBaseInstancesResult -> getBaseInstancesResult.instances()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:ocean:getBaseInstances
      arguments: {}
  nameRegex:
    fn::invoke:
      function: alicloud:ocean:getBaseInstances
      arguments:
        nameRegex: ^my-Instance
outputs:
  oceanBaseInstanceId1: ${ids.instances[0].id}
  oceanBaseInstanceId2: ${nameRegex.instances[0].id}
Copy

Using getBaseInstances

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 getBaseInstances(args: GetBaseInstancesArgs, opts?: InvokeOptions): Promise<GetBaseInstancesResult>
function getBaseInstancesOutput(args: GetBaseInstancesOutputArgs, opts?: InvokeOptions): Output<GetBaseInstancesResult>
Copy
def get_base_instances(enable_details: Optional[bool] = None,
                       ids: Optional[Sequence[str]] = None,
                       instance_id: Optional[str] = None,
                       instance_name: Optional[str] = None,
                       name_regex: Optional[str] = None,
                       output_file: Optional[str] = None,
                       page_number: Optional[int] = None,
                       page_size: Optional[int] = None,
                       resource_group_id: Optional[str] = None,
                       search_key: Optional[str] = None,
                       status: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetBaseInstancesResult
def get_base_instances_output(enable_details: Optional[pulumi.Input[bool]] = None,
                       ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                       instance_id: Optional[pulumi.Input[str]] = None,
                       instance_name: Optional[pulumi.Input[str]] = None,
                       name_regex: Optional[pulumi.Input[str]] = None,
                       output_file: Optional[pulumi.Input[str]] = None,
                       page_number: Optional[pulumi.Input[int]] = None,
                       page_size: Optional[pulumi.Input[int]] = None,
                       resource_group_id: Optional[pulumi.Input[str]] = None,
                       search_key: Optional[pulumi.Input[str]] = None,
                       status: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetBaseInstancesResult]
Copy
func GetBaseInstances(ctx *Context, args *GetBaseInstancesArgs, opts ...InvokeOption) (*GetBaseInstancesResult, error)
func GetBaseInstancesOutput(ctx *Context, args *GetBaseInstancesOutputArgs, opts ...InvokeOption) GetBaseInstancesResultOutput
Copy

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

public static class GetBaseInstances 
{
    public static Task<GetBaseInstancesResult> InvokeAsync(GetBaseInstancesArgs args, InvokeOptions? opts = null)
    public static Output<GetBaseInstancesResult> Invoke(GetBaseInstancesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetBaseInstancesResult> getBaseInstances(GetBaseInstancesArgs args, InvokeOptions options)
public static Output<GetBaseInstancesResult> getBaseInstances(GetBaseInstancesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:ocean/getBaseInstances:getBaseInstances
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

EnableDetails bool
Ids List<string>
A list of Instance IDs.
InstanceId Changes to this property will trigger replacement. string
OceanBase cluster ID.
InstanceName Changes to this property will trigger replacement. string
OceanBase cluster name. The length is 1 to 20 English or Chinese characters. If this parameter is not specified, the default value is the InstanceId of the cluster.
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).
PageNumber int
PageSize int
ResourceGroupId Changes to this property will trigger replacement. string
The ID of the enterprise resource group to which the instance resides.
SearchKey Changes to this property will trigger replacement. string
The filter keyword for the query list.
Status Changes to this property will trigger replacement. string
The status of the Instance. Value range: PENDING_CREATE, ONLINE, TENANT_CREATING, TENANT_SPEC_MODIFYING, EXPANDING, REDUCING, SPEC_UPGRADING, DISK_UPGRADING, WHITE_LIST_MODIFYING, PARAMETER_MODIFYING, SSL_MODIFYING, PREPAID_EXPIRE_CLOSED, ARREARS_CLOSED, PENDING_DELETE.
EnableDetails bool
Ids []string
A list of Instance IDs.
InstanceId Changes to this property will trigger replacement. string
OceanBase cluster ID.
InstanceName Changes to this property will trigger replacement. string
OceanBase cluster name. The length is 1 to 20 English or Chinese characters. If this parameter is not specified, the default value is the InstanceId of the cluster.
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).
PageNumber int
PageSize int
ResourceGroupId Changes to this property will trigger replacement. string
The ID of the enterprise resource group to which the instance resides.
SearchKey Changes to this property will trigger replacement. string
The filter keyword for the query list.
Status Changes to this property will trigger replacement. string
The status of the Instance. Value range: PENDING_CREATE, ONLINE, TENANT_CREATING, TENANT_SPEC_MODIFYING, EXPANDING, REDUCING, SPEC_UPGRADING, DISK_UPGRADING, WHITE_LIST_MODIFYING, PARAMETER_MODIFYING, SSL_MODIFYING, PREPAID_EXPIRE_CLOSED, ARREARS_CLOSED, PENDING_DELETE.
enableDetails Boolean
ids List<String>
A list of Instance IDs.
instanceId Changes to this property will trigger replacement. String
OceanBase cluster ID.
instanceName Changes to this property will trigger replacement. String
OceanBase cluster name. The length is 1 to 20 English or Chinese characters. If this parameter is not specified, the default value is the InstanceId of the cluster.
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).
pageNumber Integer
pageSize Integer
resourceGroupId Changes to this property will trigger replacement. String
The ID of the enterprise resource group to which the instance resides.
searchKey Changes to this property will trigger replacement. String
The filter keyword for the query list.
status Changes to this property will trigger replacement. String
The status of the Instance. Value range: PENDING_CREATE, ONLINE, TENANT_CREATING, TENANT_SPEC_MODIFYING, EXPANDING, REDUCING, SPEC_UPGRADING, DISK_UPGRADING, WHITE_LIST_MODIFYING, PARAMETER_MODIFYING, SSL_MODIFYING, PREPAID_EXPIRE_CLOSED, ARREARS_CLOSED, PENDING_DELETE.
enableDetails boolean
ids string[]
A list of Instance IDs.
instanceId Changes to this property will trigger replacement. string
OceanBase cluster ID.
instanceName Changes to this property will trigger replacement. string
OceanBase cluster name. The length is 1 to 20 English or Chinese characters. If this parameter is not specified, the default value is the InstanceId of the cluster.
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).
pageNumber number
pageSize number
resourceGroupId Changes to this property will trigger replacement. string
The ID of the enterprise resource group to which the instance resides.
searchKey Changes to this property will trigger replacement. string
The filter keyword for the query list.
status Changes to this property will trigger replacement. string
The status of the Instance. Value range: PENDING_CREATE, ONLINE, TENANT_CREATING, TENANT_SPEC_MODIFYING, EXPANDING, REDUCING, SPEC_UPGRADING, DISK_UPGRADING, WHITE_LIST_MODIFYING, PARAMETER_MODIFYING, SSL_MODIFYING, PREPAID_EXPIRE_CLOSED, ARREARS_CLOSED, PENDING_DELETE.
enable_details bool
ids Sequence[str]
A list of Instance IDs.
instance_id Changes to this property will trigger replacement. str
OceanBase cluster ID.
instance_name Changes to this property will trigger replacement. str
OceanBase cluster name. The length is 1 to 20 English or Chinese characters. If this parameter is not specified, the default value is the InstanceId of the cluster.
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).
page_number int
page_size int
resource_group_id Changes to this property will trigger replacement. str
The ID of the enterprise resource group to which the instance resides.
search_key Changes to this property will trigger replacement. str
The filter keyword for the query list.
status Changes to this property will trigger replacement. str
The status of the Instance. Value range: PENDING_CREATE, ONLINE, TENANT_CREATING, TENANT_SPEC_MODIFYING, EXPANDING, REDUCING, SPEC_UPGRADING, DISK_UPGRADING, WHITE_LIST_MODIFYING, PARAMETER_MODIFYING, SSL_MODIFYING, PREPAID_EXPIRE_CLOSED, ARREARS_CLOSED, PENDING_DELETE.
enableDetails Boolean
ids List<String>
A list of Instance IDs.
instanceId Changes to this property will trigger replacement. String
OceanBase cluster ID.
instanceName Changes to this property will trigger replacement. String
OceanBase cluster name. The length is 1 to 20 English or Chinese characters. If this parameter is not specified, the default value is the InstanceId of the cluster.
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).
pageNumber Number
pageSize Number
resourceGroupId Changes to this property will trigger replacement. String
The ID of the enterprise resource group to which the instance resides.
searchKey Changes to this property will trigger replacement. String
The filter keyword for the query list.
status Changes to this property will trigger replacement. String
The status of the Instance. Value range: PENDING_CREATE, ONLINE, TENANT_CREATING, TENANT_SPEC_MODIFYING, EXPANDING, REDUCING, SPEC_UPGRADING, DISK_UPGRADING, WHITE_LIST_MODIFYING, PARAMETER_MODIFYING, SSL_MODIFYING, PREPAID_EXPIRE_CLOSED, ARREARS_CLOSED, PENDING_DELETE.

getBaseInstances 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.Ocean.Outputs.GetBaseInstancesInstance>
Names List<string>
EnableDetails bool
InstanceId string
InstanceName string
NameRegex string
OutputFile string
PageNumber int
PageSize int
ResourceGroupId string
SearchKey string
Status string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Instances []GetBaseInstancesInstance
Names []string
EnableDetails bool
InstanceId string
InstanceName string
NameRegex string
OutputFile string
PageNumber int
PageSize int
ResourceGroupId string
SearchKey string
Status string
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
instances List<GetBaseInstancesInstance>
names List<String>
enableDetails Boolean
instanceId String
instanceName String
nameRegex String
outputFile String
pageNumber Integer
pageSize Integer
resourceGroupId String
searchKey String
status String
id string
The provider-assigned unique ID for this managed resource.
ids string[]
instances GetBaseInstancesInstance[]
names string[]
enableDetails boolean
instanceId string
instanceName string
nameRegex string
outputFile string
pageNumber number
pageSize number
resourceGroupId string
searchKey string
status string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
instances Sequence[GetBaseInstancesInstance]
names Sequence[str]
enable_details bool
instance_id str
instance_name str
name_regex str
output_file str
page_number int
page_size int
resource_group_id str
search_key str
status str
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
instances List<Property Map>
names List<String>
enableDetails Boolean
instanceId String
instanceName String
nameRegex String
outputFile String
pageNumber Number
pageSize Number
resourceGroupId String
searchKey String
status String

Supporting Types

GetBaseInstancesInstance

CommodityCode This property is required. string
The product code of the OceanBase cluster.
Cpu This property is required. int
The number of CPU cores of the cluster.
CreateTime This property is required. string
The creation time of the resource.
DiskSize This property is required. string
The size of the storage space, in GB.
Id This property is required. string
The ID of the Instance.
InstanceClass This property is required. string
Cluster specification information.
InstanceId This property is required. string
OceanBase cluster ID.
InstanceName This property is required. string
OceanBase cluster name.
NodeNum This property is required. string
The number of nodes in the cluster.
PaymentType This property is required. string
The payment method of the instance.
ResourceGroupId This property is required. string
The ID of the enterprise resource group to which the instance resides.
Series This property is required. string
Series of OceanBase clusters.
Status This property is required. string
The status of the resource.
Zones This property is required. List<string>
Information about the zone where the cluster is deployed.
CommodityCode This property is required. string
The product code of the OceanBase cluster.
Cpu This property is required. int
The number of CPU cores of the cluster.
CreateTime This property is required. string
The creation time of the resource.
DiskSize This property is required. string
The size of the storage space, in GB.
Id This property is required. string
The ID of the Instance.
InstanceClass This property is required. string
Cluster specification information.
InstanceId This property is required. string
OceanBase cluster ID.
InstanceName This property is required. string
OceanBase cluster name.
NodeNum This property is required. string
The number of nodes in the cluster.
PaymentType This property is required. string
The payment method of the instance.
ResourceGroupId This property is required. string
The ID of the enterprise resource group to which the instance resides.
Series This property is required. string
Series of OceanBase clusters.
Status This property is required. string
The status of the resource.
Zones This property is required. []string
Information about the zone where the cluster is deployed.
commodityCode This property is required. String
The product code of the OceanBase cluster.
cpu This property is required. Integer
The number of CPU cores of the cluster.
createTime This property is required. String
The creation time of the resource.
diskSize This property is required. String
The size of the storage space, in GB.
id This property is required. String
The ID of the Instance.
instanceClass This property is required. String
Cluster specification information.
instanceId This property is required. String
OceanBase cluster ID.
instanceName This property is required. String
OceanBase cluster name.
nodeNum This property is required. String
The number of nodes in the cluster.
paymentType This property is required. String
The payment method of the instance.
resourceGroupId This property is required. String
The ID of the enterprise resource group to which the instance resides.
series This property is required. String
Series of OceanBase clusters.
status This property is required. String
The status of the resource.
zones This property is required. List<String>
Information about the zone where the cluster is deployed.
commodityCode This property is required. string
The product code of the OceanBase cluster.
cpu This property is required. number
The number of CPU cores of the cluster.
createTime This property is required. string
The creation time of the resource.
diskSize This property is required. string
The size of the storage space, in GB.
id This property is required. string
The ID of the Instance.
instanceClass This property is required. string
Cluster specification information.
instanceId This property is required. string
OceanBase cluster ID.
instanceName This property is required. string
OceanBase cluster name.
nodeNum This property is required. string
The number of nodes in the cluster.
paymentType This property is required. string
The payment method of the instance.
resourceGroupId This property is required. string
The ID of the enterprise resource group to which the instance resides.
series This property is required. string
Series of OceanBase clusters.
status This property is required. string
The status of the resource.
zones This property is required. string[]
Information about the zone where the cluster is deployed.
commodity_code This property is required. str
The product code of the OceanBase cluster.
cpu This property is required. int
The number of CPU cores of the cluster.
create_time This property is required. str
The creation time of the resource.
disk_size This property is required. str
The size of the storage space, in GB.
id This property is required. str
The ID of the Instance.
instance_class This property is required. str
Cluster specification information.
instance_id This property is required. str
OceanBase cluster ID.
instance_name This property is required. str
OceanBase cluster name.
node_num This property is required. str
The number of nodes in the cluster.
payment_type This property is required. str
The payment method of the instance.
resource_group_id This property is required. str
The ID of the enterprise resource group to which the instance resides.
series This property is required. str
Series of OceanBase clusters.
status This property is required. str
The status of the resource.
zones This property is required. Sequence[str]
Information about the zone where the cluster is deployed.
commodityCode This property is required. String
The product code of the OceanBase cluster.
cpu This property is required. Number
The number of CPU cores of the cluster.
createTime This property is required. String
The creation time of the resource.
diskSize This property is required. String
The size of the storage space, in GB.
id This property is required. String
The ID of the Instance.
instanceClass This property is required. String
Cluster specification information.
instanceId This property is required. String
OceanBase cluster ID.
instanceName This property is required. String
OceanBase cluster name.
nodeNum This property is required. String
The number of nodes in the cluster.
paymentType This property is required. String
The payment method of the instance.
resourceGroupId This property is required. String
The ID of the enterprise resource group to which the instance resides.
series This property is required. String
Series of OceanBase clusters.
status This property is required. String
The status of the resource.
zones This property is required. List<String>
Information about the zone where the cluster is deployed.

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