1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ocean
  5. getBaseInstances
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.ocean.getBaseInstances

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 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);
    
    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:

    EnableDetails bool
    Ids List<string>
    A list of Instance IDs.
    InstanceId string
    OceanBase cluster ID.
    InstanceName string
    OceanBase cluster name.
    NameRegex 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 string
    The ID of the enterprise resource group to which the instance resides.
    SearchKey string
    The filter keyword for the query list.
    Status string
    The status of the resource.
    EnableDetails bool
    Ids []string
    A list of Instance IDs.
    InstanceId string
    OceanBase cluster ID.
    InstanceName string
    OceanBase cluster name.
    NameRegex 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 string
    The ID of the enterprise resource group to which the instance resides.
    SearchKey string
    The filter keyword for the query list.
    Status string
    The status of the resource.
    enableDetails Boolean
    ids List<String>
    A list of Instance IDs.
    instanceId String
    OceanBase cluster ID.
    instanceName String
    OceanBase cluster name.
    nameRegex 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 String
    The ID of the enterprise resource group to which the instance resides.
    searchKey String
    The filter keyword for the query list.
    status String
    The status of the resource.
    enableDetails boolean
    ids string[]
    A list of Instance IDs.
    instanceId string
    OceanBase cluster ID.
    instanceName string
    OceanBase cluster name.
    nameRegex 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 string
    The ID of the enterprise resource group to which the instance resides.
    searchKey string
    The filter keyword for the query list.
    status string
    The status of the resource.
    enable_details bool
    ids Sequence[str]
    A list of Instance IDs.
    instance_id str
    OceanBase cluster ID.
    instance_name str
    OceanBase cluster name.
    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_id str
    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 resource.
    enableDetails Boolean
    ids List<String>
    A list of Instance IDs.
    instanceId String
    OceanBase cluster ID.
    instanceName String
    OceanBase cluster name.
    nameRegex 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 String
    The ID of the enterprise resource group to which the instance resides.
    searchKey String
    The filter keyword for the query list.
    status String
    The status of the resource.

    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 string
    The product code of the OceanBase cluster.
    Cpu int
    The number of CPU cores of the cluster.
    CreateTime string
    The creation time of the resource.
    DiskSize string
    The size of the storage space, in GB.
    Id string
    The ID of the Instance.
    InstanceClass string
    Cluster specification information.
    InstanceId string
    OceanBase cluster ID.
    InstanceName string
    OceanBase cluster name.
    NodeNum string
    The number of nodes in the cluster.
    PaymentType string
    The payment method of the instance.
    ResourceGroupId string
    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.
    CommodityCode string
    The product code of the OceanBase cluster.
    Cpu int
    The number of CPU cores of the cluster.
    CreateTime string
    The creation time of the resource.
    DiskSize string
    The size of the storage space, in GB.
    Id string
    The ID of the Instance.
    InstanceClass string
    Cluster specification information.
    InstanceId string
    OceanBase cluster ID.
    InstanceName string
    OceanBase cluster name.
    NodeNum string
    The number of nodes in the cluster.
    PaymentType string
    The payment method of the instance.
    ResourceGroupId string
    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.
    commodityCode String
    The product code of the OceanBase cluster.
    cpu Integer
    The number of CPU cores of the cluster.
    createTime String
    The creation time of the resource.
    diskSize String
    The size of the storage space, in GB.
    id String
    The ID of the Instance.
    instanceClass String
    Cluster specification information.
    instanceId String
    OceanBase cluster ID.
    instanceName String
    OceanBase cluster name.
    nodeNum String
    The number of nodes in the cluster.
    paymentType String
    The payment method of the instance.
    resourceGroupId String
    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.
    commodityCode string
    The product code of the OceanBase cluster.
    cpu number
    The number of CPU cores of the cluster.
    createTime string
    The creation time of the resource.
    diskSize string
    The size of the storage space, in GB.
    id string
    The ID of the Instance.
    instanceClass string
    Cluster specification information.
    instanceId string
    OceanBase cluster ID.
    instanceName string
    OceanBase cluster name.
    nodeNum string
    The number of nodes in the cluster.
    paymentType string
    The payment method of the instance.
    resourceGroupId string
    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_id str
    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.
    commodityCode String
    The product code of the OceanBase cluster.
    cpu Number
    The number of CPU cores of the cluster.
    createTime String
    The creation time of the resource.
    diskSize String
    The size of the storage space, in GB.
    id String
    The ID of the Instance.
    instanceClass String
    Cluster specification information.
    instanceId String
    OceanBase cluster ID.
    instanceName String
    OceanBase cluster name.
    nodeNum String
    The number of nodes in the cluster.
    paymentType String
    The payment method of the instance.
    resourceGroupId String
    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.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi