Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 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, nil, 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)
// Output-based functions aren't available in Java yet
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 string - OceanBase cluster ID.
- Instance
Name 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.
- Name
Regex string - 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 stringId - The ID of the enterprise resource group to which the instance resides.
- Search
Key string - The filter keyword for the query list.
- Status 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 []string
- A list of Instance IDs.
- Instance
Id string - OceanBase cluster ID.
- Instance
Name 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.
- Name
Regex string - 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 stringId - The ID of the enterprise resource group to which the instance resides.
- Search
Key string - The filter keyword for the query list.
- Status 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 Boolean - ids List<String>
- A list of Instance IDs.
- instance
Id String - OceanBase cluster ID.
- instance
Name 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.
- name
Regex String - 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 StringId - The ID of the enterprise resource group to which the instance resides.
- search
Key String - The filter keyword for the query list.
- status 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 boolean - ids string[]
- A list of Instance IDs.
- instance
Id string - OceanBase cluster ID.
- instance
Name 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.
- name
Regex string - 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 stringId - The ID of the enterprise resource group to which the instance resides.
- search
Key string - The filter keyword for the query list.
- status 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 str - OceanBase cluster ID.
- instance_
name 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 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_ strid - The ID of the enterprise resource group to which the instance resides.
- search_
key str - The filter keyword for the query list.
- status 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
.
- enable
Details Boolean - ids List<String>
- A list of Instance IDs.
- instance
Id String - OceanBase cluster ID.
- instance
Name 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.
- name
Regex String - 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 StringId - The ID of the enterprise resource group to which the instance resides.
- search
Key String - The filter keyword for the query list.
- status 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.
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 string - The product code of the OceanBase cluster.
- Cpu int
- The number of CPU cores of the cluster.
- Create
Time string - The creation time of the resource.
- Disk
Size string - The size of the storage space, in GB.
- Id string
- The ID of the Instance.
- Instance
Class string - Cluster specification information.
- Instance
Id string - OceanBase cluster ID.
- Instance
Name string - OceanBase cluster name.
- Node
Num string - The number of nodes in the cluster.
- Payment
Type string - The payment method of the instance.
- Resource
Group stringId - The ID of the enterprise resource group to which the instance resides.
- Series string
- Series of OceanBase clusters.
- Status string
- The status of the resource.
- Zones List<string>
- Information about the zone where the cluster is deployed.
- Commodity
Code string - The product code of the OceanBase cluster.
- Cpu int
- The number of CPU cores of the cluster.
- Create
Time string - The creation time of the resource.
- Disk
Size string - The size of the storage space, in GB.
- Id string
- The ID of the Instance.
- Instance
Class string - Cluster specification information.
- Instance
Id string - OceanBase cluster ID.
- Instance
Name string - OceanBase cluster name.
- Node
Num string - The number of nodes in the cluster.
- Payment
Type string - The payment method of the instance.
- Resource
Group stringId - The ID of the enterprise resource group to which the instance resides.
- Series string
- Series of OceanBase clusters.
- Status string
- The status of the resource.
- Zones []string
- Information about the zone where the cluster is deployed.
- commodity
Code String - The product code of the OceanBase cluster.
- cpu Integer
- The number of CPU cores of the cluster.
- create
Time String - The creation time of the resource.
- disk
Size String - The size of the storage space, in GB.
- id String
- The ID of the Instance.
- instance
Class String - Cluster specification information.
- instance
Id String - OceanBase cluster ID.
- instance
Name String - OceanBase cluster name.
- node
Num String - The number of nodes in the cluster.
- payment
Type String - The payment method of the instance.
- resource
Group StringId - The ID of the enterprise resource group to which the instance resides.
- series String
- Series of OceanBase clusters.
- status String
- The status of the resource.
- zones List<String>
- Information about the zone where the cluster is deployed.
- commodity
Code string - The product code of the OceanBase cluster.
- cpu number
- The number of CPU cores of the cluster.
- create
Time string - The creation time of the resource.
- disk
Size string - The size of the storage space, in GB.
- id string
- The ID of the Instance.
- instance
Class string - Cluster specification information.
- instance
Id string - OceanBase cluster ID.
- instance
Name string - OceanBase cluster name.
- node
Num string - The number of nodes in the cluster.
- payment
Type string - The payment method of the instance.
- resource
Group stringId - The ID of the enterprise resource group to which the instance resides.
- series string
- Series of OceanBase clusters.
- status string
- The status of the resource.
- zones string[]
- Information about the zone where the cluster is deployed.
- commodity_
code str - The product code of the OceanBase cluster.
- cpu int
- The number of CPU cores of the cluster.
- create_
time str - The creation time of the resource.
- disk_
size str - The size of the storage space, in GB.
- id str
- The ID of the Instance.
- instance_
class str - Cluster specification information.
- instance_
id str - OceanBase cluster ID.
- instance_
name str - OceanBase cluster name.
- node_
num str - The number of nodes in the cluster.
- payment_
type str - The payment method of the instance.
- resource_
group_ strid - The ID of the enterprise resource group to which the instance resides.
- series str
- Series of OceanBase clusters.
- status str
- The status of the resource.
- zones Sequence[str]
- Information about the zone where the cluster is deployed.
- commodity
Code String - The product code of the OceanBase cluster.
- cpu Number
- The number of CPU cores of the cluster.
- create
Time String - The creation time of the resource.
- disk
Size String - The size of the storage space, in GB.
- id String
- The ID of the Instance.
- instance
Class String - Cluster specification information.
- instance
Id String - OceanBase cluster ID.
- instance
Name String - OceanBase cluster name.
- node
Num String - The number of nodes in the cluster.
- payment
Type String - The payment method of the instance.
- resource
Group StringId - The ID of the enterprise resource group to which the instance resides.
- series String
- Series of OceanBase clusters.
- status String
- The status of the resource.
- zones 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.