Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi
alicloud.ocean.getBaseInstances
Explore with Pulumi AI
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);
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)
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
})
}
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),
};
});
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()));
}
}
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}
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>
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]
func GetBaseInstances(ctx *Context, args *GetBaseInstancesArgs, opts ...InvokeOption) (*GetBaseInstancesResult, error)
func GetBaseInstancesOutput(ctx *Context, args *GetBaseInstancesOutputArgs, opts ...InvokeOption) GetBaseInstancesResultOutput
> 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)
}
public static CompletableFuture<GetBaseInstancesResult> getBaseInstances(GetBaseInstancesArgs args, InvokeOptions options)
public static Output<GetBaseInstancesResult> getBaseInstances(GetBaseInstancesArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:ocean/getBaseInstances:getBaseInstances
arguments:
# arguments dictionary
The following arguments are supported:
- Enable
Details bool - Ids List<string>
- A list of Instance IDs.
- Instance
Id Changes to this property will trigger replacement.
- OceanBase cluster ID.
- Instance
Name Changes to this property will trigger replacement.
- 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.
- A regex string to filter results by Instance name.
- Output
File string - 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.
- The ID of the enterprise resource group to which the instance resides.
- Search
Key Changes to this property will trigger replacement.
- The filter keyword for the query list.
- Status
Changes to this property will trigger replacement.
- 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 []string
- A list of Instance IDs.
- Instance
Id Changes to this property will trigger replacement.
- OceanBase cluster ID.
- Instance
Name Changes to this property will trigger replacement.
- 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.
- A regex string to filter results by Instance name.
- Output
File string - 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.
- The ID of the enterprise resource group to which the instance resides.
- Search
Key Changes to this property will trigger replacement.
- The filter keyword for the query list.
- Status
Changes to this property will trigger replacement.
- 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 Boolean - ids List<String>
- A list of Instance IDs.
- instance
Id Changes to this property will trigger replacement.
- OceanBase cluster ID.
- instance
Name Changes to this property will trigger replacement.
- 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.
- A regex string to filter results by Instance name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - page
Number Integer - page
Size Integer - resource
Group Id Changes to this property will trigger replacement.
- The ID of the enterprise resource group to which the instance resides.
- search
Key Changes to this property will trigger replacement.
- The filter keyword for the query list.
- status
Changes to this property will trigger replacement.
- 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 boolean - ids string[]
- A list of Instance IDs.
- instance
Id Changes to this property will trigger replacement.
- OceanBase cluster ID.
- instance
Name Changes to this property will trigger replacement.
- 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.
- A regex string to filter results by Instance name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - page
Number number - page
Size number - resource
Group Id Changes to this property will trigger replacement.
- The ID of the enterprise resource group to which the instance resides.
- search
Key Changes to this property will trigger replacement.
- The filter keyword for the query list.
- status
Changes to this property will trigger replacement.
- 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.
- OceanBase cluster ID.
- instance_
name Changes to this property will trigger replacement.
- 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.
- 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.
- The ID of the enterprise resource group to which the instance resides.
- search_
key Changes to this property will trigger replacement.
- The filter keyword for the query list.
- status
Changes to this property will trigger replacement.
- 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 Boolean - ids List<String>
- A list of Instance IDs.
- instance
Id Changes to this property will trigger replacement.
- OceanBase cluster ID.
- instance
Name Changes to this property will trigger replacement.
- 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.
- A regex string to filter results by Instance name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - page
Number Number - page
Size Number - resource
Group Id Changes to this property will trigger replacement.
- The ID of the enterprise resource group to which the instance resides.
- search
Key Changes to this property will trigger replacement.
- The filter keyword for the query list.
- status
Changes to this property will trigger replacement.
- 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.
Ali Cloud. Ocean. Outputs. Get Base Instances Instance> - Names List<string>
- Enable
Details bool - Instance
Id string - Instance
Name string - Name
Regex string - Output
File string - Page
Number int - Page
Size int - Resource
Group stringId - Search
Key string - Status string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Instances
[]Get
Base Instances Instance - Names []string
- Enable
Details bool - Instance
Id string - Instance
Name string - Name
Regex string - Output
File string - Page
Number int - Page
Size int - Resource
Group stringId - Search
Key string - Status string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- instances
List<Get
Base Instances Instance> - names List<String>
- enable
Details Boolean - instance
Id String - instance
Name String - name
Regex String - output
File String - page
Number Integer - page
Size Integer - resource
Group StringId - search
Key String - status String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- instances
Get
Base Instances Instance[] - names string[]
- enable
Details boolean - instance
Id string - instance
Name string - name
Regex string - output
File string - page
Number number - page
Size number - resource
Group stringId - search
Key string - status string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- instances
Sequence[Get
Base Instances Instance] - 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_ strid - 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>
- enable
Details Boolean - instance
Id String - instance
Name String - name
Regex String - output
File String - page
Number Number - page
Size Number - resource
Group StringId - search
Key String - status String
Supporting Types
GetBaseInstancesInstance
- Commodity
Code 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.
- Create
Time This property is required. string - The creation time of the resource.
- Disk
Size This property is required. string - The size of the storage space, in GB.
- Id
This property is required. string - The ID of the Instance.
- Instance
Class This property is required. string - Cluster specification information.
- Instance
Id This property is required. string - OceanBase cluster ID.
- Instance
Name This property is required. string - OceanBase cluster name.
- Node
Num This property is required. string - The number of nodes in the cluster.
- Payment
Type This property is required. string - The payment method of the instance.
- Resource
Group Id 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.
- Commodity
Code 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.
- Create
Time This property is required. string - The creation time of the resource.
- Disk
Size This property is required. string - The size of the storage space, in GB.
- Id
This property is required. string - The ID of the Instance.
- Instance
Class This property is required. string - Cluster specification information.
- Instance
Id This property is required. string - OceanBase cluster ID.
- Instance
Name This property is required. string - OceanBase cluster name.
- Node
Num This property is required. string - The number of nodes in the cluster.
- Payment
Type This property is required. string - The payment method of the instance.
- Resource
Group Id 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. String - The product code of the OceanBase cluster.
- cpu
This property is required. Integer - The number of CPU cores of the cluster.
- create
Time This property is required. String - The creation time of the resource.
- disk
Size This property is required. String - The size of the storage space, in GB.
- id
This property is required. String - The ID of the Instance.
- instance
Class This property is required. String - Cluster specification information.
- instance
Id This property is required. String - OceanBase cluster ID.
- instance
Name This property is required. String - OceanBase cluster name.
- node
Num This property is required. String - The number of nodes in the cluster.
- payment
Type This property is required. String - The payment method of the instance.
- resource
Group Id 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.
- commodity
Code 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.
- create
Time This property is required. string - The creation time of the resource.
- disk
Size This property is required. string - The size of the storage space, in GB.
- id
This property is required. string - The ID of the Instance.
- instance
Class This property is required. string - Cluster specification information.
- instance
Id This property is required. string - OceanBase cluster ID.
- instance
Name This property is required. string - OceanBase cluster name.
- node
Num This property is required. string - The number of nodes in the cluster.
- payment
Type This property is required. string - The payment method of the instance.
- resource
Group Id 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.
- commodity
Code 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.
- create
Time This property is required. String - The creation time of the resource.
- disk
Size This property is required. String - The size of the storage space, in GB.
- id
This property is required. String - The ID of the Instance.
- instance
Class This property is required. String - Cluster specification information.
- instance
Id This property is required. String - OceanBase cluster ID.
- instance
Name This property is required. String - OceanBase cluster name.
- node
Num This property is required. String - The number of nodes in the cluster.
- payment
Type This property is required. String - The payment method of the instance.
- resource
Group Id 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.