Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getClusters

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var adbClustersDs = Output.Create(AliCloud.Adb.GetClusters.InvokeAsync(new AliCloud.Adb.GetClustersArgs
        {
            DescriptionRegex = "am-\\w+",
            Status = "Running",
        }));
        this.FirstAdbClusterId = adbClustersDs.Apply(adbClustersDs => adbClustersDs.Clusters?[0]?.Id);
    }

    [Output("firstAdbClusterId")]
    public Output<string> FirstAdbClusterId { get; set; }
}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		adbClustersDs, err := adb.GetClusters(ctx, &adb.GetClustersArgs{
			DescriptionRegex: pulumi.StringRef("am-\\w+"),
			Status:           pulumi.StringRef("Running"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstAdbClusterId", adbClustersDs.Clusters[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.adb.AdbFunctions;
import com.pulumi.alicloud.adb.inputs.GetClustersArgs;
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 adbClustersDs = AdbFunctions.getClusters(GetClustersArgs.builder()
            .descriptionRegex("am-\\w+")
            .status("Running")
            .build());

        ctx.export("firstAdbClusterId", adbClustersDs.applyValue(getClustersResult -> getClustersResult.clusters()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

adb_clusters_ds = alicloud.adb.get_clusters(description_regex="am-\\w+",
    status="Running")
pulumi.export("firstAdbClusterId", adb_clusters_ds.clusters[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const adbClustersDs = alicloud.adb.getClusters({
    descriptionRegex: "am-\\w+",
    status: "Running",
});
export const firstAdbClusterId = adbClustersDs.then(adbClustersDs => adbClustersDs.clusters?[0]?.id);
variables:
  adbClustersDs:
    Fn::Invoke:
      Function: alicloud:adb:getClusters
      Arguments:
        descriptionRegex: am-\w+
        status: Running
outputs:
  firstAdbClusterId: ${adbClustersDs.clusters[0].id}

Using getClusters

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 getClusters(args: GetClustersArgs, opts?: InvokeOptions): Promise<GetClustersResult>
function getClustersOutput(args: GetClustersOutputArgs, opts?: InvokeOptions): Output<GetClustersResult>
def get_clusters(description: Optional[str] = None,
                 description_regex: Optional[str] = None,
                 enable_details: Optional[bool] = None,
                 ids: Optional[Sequence[str]] = None,
                 output_file: Optional[str] = None,
                 page_number: Optional[int] = None,
                 page_size: Optional[int] = None,
                 resource_group_id: Optional[str] = None,
                 status: Optional[str] = None,
                 tags: Optional[Mapping[str, Any]] = None,
                 opts: Optional[InvokeOptions] = None) -> GetClustersResult
def get_clusters_output(description: Optional[pulumi.Input[str]] = None,
                 description_regex: Optional[pulumi.Input[str]] = None,
                 enable_details: Optional[pulumi.Input[bool]] = None,
                 ids: Optional[pulumi.Input[Sequence[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,
                 status: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetClustersResult]
func GetClusters(ctx *Context, args *GetClustersArgs, opts ...InvokeOption) (*GetClustersResult, error)
func GetClustersOutput(ctx *Context, args *GetClustersOutputArgs, opts ...InvokeOption) GetClustersResultOutput

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

public static class GetClusters 
{
    public static Task<GetClustersResult> InvokeAsync(GetClustersArgs args, InvokeOptions? opts = null)
    public static Output<GetClustersResult> Invoke(GetClustersInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetClustersResult> getClusters(GetClustersArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:adb/getClusters:getClusters
  arguments:
    # arguments dictionary

The following arguments are supported:

Description string

The description of the ADB cluster.

DescriptionRegex string

A regex string to filter results by cluster description.

EnableDetails bool
Ids List<string>

A list of ADB cluster IDs.

OutputFile string
PageNumber int
PageSize int
ResourceGroupId string
Status string

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
Description string

The description of the ADB cluster.

DescriptionRegex string

A regex string to filter results by cluster description.

EnableDetails bool
Ids []string

A list of ADB cluster IDs.

OutputFile string
PageNumber int
PageSize int
ResourceGroupId string
Status string

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
description String

The description of the ADB cluster.

descriptionRegex String

A regex string to filter results by cluster description.

enableDetails Boolean
ids List<String>

A list of ADB cluster IDs.

outputFile String
pageNumber Integer
pageSize Integer
resourceGroupId String
status String

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

tags Map<String,Object>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
description string

The description of the ADB cluster.

descriptionRegex string

A regex string to filter results by cluster description.

enableDetails boolean
ids string[]

A list of ADB cluster IDs.

outputFile string
pageNumber number
pageSize number
resourceGroupId string
status string

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
description str

The description of the ADB cluster.

description_regex str

A regex string to filter results by cluster description.

enable_details bool
ids Sequence[str]

A list of ADB cluster IDs.

output_file str
page_number int
page_size int
resource_group_id str
status str

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
description String

The description of the ADB cluster.

descriptionRegex String

A regex string to filter results by cluster description.

enableDetails Boolean
ids List<String>

A list of ADB cluster IDs.

outputFile String
pageNumber Number
pageSize Number
resourceGroupId String
status String

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

tags Map<Any>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.

getClusters Result

The following output properties are available:

Clusters List<Pulumi.AliCloud.Adb.Outputs.GetClustersCluster>

A list of ADB clusters. Each element contains the following attributes:

Descriptions List<string>

A list of ADB cluster descriptions.

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of ADB cluster IDs.

TotalCount int
Description string

The description of the ADB cluster.

DescriptionRegex string
EnableDetails bool
OutputFile string
PageNumber int
PageSize int
ResourceGroupId string
Status string

Status of the cluster.

Tags Dictionary<string, object>
Clusters []GetClustersCluster

A list of ADB clusters. Each element contains the following attributes:

Descriptions []string

A list of ADB cluster descriptions.

Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of ADB cluster IDs.

TotalCount int
Description string

The description of the ADB cluster.

DescriptionRegex string
EnableDetails bool
OutputFile string
PageNumber int
PageSize int
ResourceGroupId string
Status string

Status of the cluster.

Tags map[string]interface{}
clusters List<GetClustersCluster>

A list of ADB clusters. Each element contains the following attributes:

descriptions List<String>

A list of ADB cluster descriptions.

id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of ADB cluster IDs.

totalCount Integer
description String

The description of the ADB cluster.

descriptionRegex String
enableDetails Boolean
outputFile String
pageNumber Integer
pageSize Integer
resourceGroupId String
status String

Status of the cluster.

tags Map<String,Object>
clusters GetClustersCluster[]

A list of ADB clusters. Each element contains the following attributes:

descriptions string[]

A list of ADB cluster descriptions.

id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of ADB cluster IDs.

totalCount number
description string

The description of the ADB cluster.

descriptionRegex string
enableDetails boolean
outputFile string
pageNumber number
pageSize number
resourceGroupId string
status string

Status of the cluster.

tags {[key: string]: any}
clusters Sequence[GetClustersCluster]

A list of ADB clusters. Each element contains the following attributes:

descriptions Sequence[str]

A list of ADB cluster descriptions.

id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

A list of ADB cluster IDs.

total_count int
description str

The description of the ADB cluster.

description_regex str
enable_details bool
output_file str
page_number int
page_size int
resource_group_id str
status str

Status of the cluster.

tags Mapping[str, Any]
clusters List<Property Map>

A list of ADB clusters. Each element contains the following attributes:

descriptions List<String>

A list of ADB cluster descriptions.

id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of ADB cluster IDs.

totalCount Number
description String

The description of the ADB cluster.

descriptionRegex String
enableDetails Boolean
outputFile String
pageNumber Number
pageSize Number
resourceGroupId String
status String

Status of the cluster.

tags Map<Any>

Supporting Types

GetClustersCluster

AutoRenewPeriod int
ChargeType string

Billing method. Value options: PostPaid for Pay-As-You-Go and PrePaid for subscription.

CommodityCode string
ComputeResource string
ConnectionString string
CreateTime string

The CreateTime of the ADB cluster.

DbClusterCategory string
DbClusterId string
DbClusterNetworkType string
DbClusterType string
DbClusterVersion string
DbNodeClass string

The DBNodeClass of the ADB cluster.

DbNodeCount int

The DBNodeCount of the ADB cluster.

DbNodeStorage int

The DBNodeStorage of the ADB cluster.

Description string

The description of the ADB cluster.

DiskType string
DtsJobId string
ElasticIoResource int
Engine string
EngineVersion string
ExecutorCount string
ExpireTime string

Expiration time. Pay-As-You-Go clusters never expire.

Expired string

The expired of the ADB cluster.

Id string

The ID of the ADB cluster.

LockMode string

The LockMode of the ADB cluster.

LockReason string
MaintainTime string
Mode string
NetworkType string

The DBClusterNetworkType of the ADB cluster.

PaymentType string
Port int
RdsInstanceId string
RegionId string

Region ID the cluster belongs to.

RenewalStatus string
ResourceGroupId string
SecurityIps List<string>
Status string

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

StorageResource string
Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
VpcCloudInstanceId string
VpcId string

ID of the VPC the cluster belongs to.

VswitchId string
ZoneId string

The ZoneId of the ADB cluster.

AutoRenewPeriod int
ChargeType string

Billing method. Value options: PostPaid for Pay-As-You-Go and PrePaid for subscription.

CommodityCode string
ComputeResource string
ConnectionString string
CreateTime string

The CreateTime of the ADB cluster.

DbClusterCategory string
DbClusterId string
DbClusterNetworkType string
DbClusterType string
DbClusterVersion string
DbNodeClass string

The DBNodeClass of the ADB cluster.

DbNodeCount int

The DBNodeCount of the ADB cluster.

DbNodeStorage int

The DBNodeStorage of the ADB cluster.

Description string

The description of the ADB cluster.

DiskType string
DtsJobId string
ElasticIoResource int
Engine string
EngineVersion string
ExecutorCount string
ExpireTime string

Expiration time. Pay-As-You-Go clusters never expire.

Expired string

The expired of the ADB cluster.

Id string

The ID of the ADB cluster.

LockMode string

The LockMode of the ADB cluster.

LockReason string
MaintainTime string
Mode string
NetworkType string

The DBClusterNetworkType of the ADB cluster.

PaymentType string
Port int
RdsInstanceId string
RegionId string

Region ID the cluster belongs to.

RenewalStatus string
ResourceGroupId string
SecurityIps []string
Status string

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

StorageResource string
Tags map[string]interface{}

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
VpcCloudInstanceId string
VpcId string

ID of the VPC the cluster belongs to.

VswitchId string
ZoneId string

The ZoneId of the ADB cluster.

autoRenewPeriod Integer
chargeType String

Billing method. Value options: PostPaid for Pay-As-You-Go and PrePaid for subscription.

commodityCode String
computeResource String
connectionString String
createTime String

The CreateTime of the ADB cluster.

dbClusterCategory String
dbClusterId String
dbClusterNetworkType String
dbClusterType String
dbClusterVersion String
dbNodeClass String

The DBNodeClass of the ADB cluster.

dbNodeCount Integer

The DBNodeCount of the ADB cluster.

dbNodeStorage Integer

The DBNodeStorage of the ADB cluster.

description String

The description of the ADB cluster.

diskType String
dtsJobId String
elasticIoResource Integer
engine String
engineVersion String
executorCount String
expireTime String

Expiration time. Pay-As-You-Go clusters never expire.

expired String

The expired of the ADB cluster.

id String

The ID of the ADB cluster.

lockMode String

The LockMode of the ADB cluster.

lockReason String
maintainTime String
mode String
networkType String

The DBClusterNetworkType of the ADB cluster.

paymentType String
port Integer
rdsInstanceId String
regionId String

Region ID the cluster belongs to.

renewalStatus String
resourceGroupId String
securityIps List<String>
status String

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

storageResource String
tags Map<String,Object>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
vpcCloudInstanceId String
vpcId String

ID of the VPC the cluster belongs to.

vswitchId String
zoneId String

The ZoneId of the ADB cluster.

autoRenewPeriod number
chargeType string

Billing method. Value options: PostPaid for Pay-As-You-Go and PrePaid for subscription.

commodityCode string
computeResource string
connectionString string
createTime string

The CreateTime of the ADB cluster.

dbClusterCategory string
dbClusterId string
dbClusterNetworkType string
dbClusterType string
dbClusterVersion string
dbNodeClass string

The DBNodeClass of the ADB cluster.

dbNodeCount number

The DBNodeCount of the ADB cluster.

dbNodeStorage number

The DBNodeStorage of the ADB cluster.

description string

The description of the ADB cluster.

diskType string
dtsJobId string
elasticIoResource number
engine string
engineVersion string
executorCount string
expireTime string

Expiration time. Pay-As-You-Go clusters never expire.

expired string

The expired of the ADB cluster.

id string

The ID of the ADB cluster.

lockMode string

The LockMode of the ADB cluster.

lockReason string
maintainTime string
mode string
networkType string

The DBClusterNetworkType of the ADB cluster.

paymentType string
port number
rdsInstanceId string
regionId string

Region ID the cluster belongs to.

renewalStatus string
resourceGroupId string
securityIps string[]
status string

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

storageResource string
tags {[key: string]: any}

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
vpcCloudInstanceId string
vpcId string

ID of the VPC the cluster belongs to.

vswitchId string
zoneId string

The ZoneId of the ADB cluster.

auto_renew_period int
charge_type str

Billing method. Value options: PostPaid for Pay-As-You-Go and PrePaid for subscription.

commodity_code str
compute_resource str
connection_string str
create_time str

The CreateTime of the ADB cluster.

db_cluster_category str
db_cluster_id str
db_cluster_network_type str
db_cluster_type str
db_cluster_version str
db_node_class str

The DBNodeClass of the ADB cluster.

db_node_count int

The DBNodeCount of the ADB cluster.

db_node_storage int

The DBNodeStorage of the ADB cluster.

description str

The description of the ADB cluster.

disk_type str
dts_job_id str
elastic_io_resource int
engine str
engine_version str
executor_count str
expire_time str

Expiration time. Pay-As-You-Go clusters never expire.

expired str

The expired of the ADB cluster.

id str

The ID of the ADB cluster.

lock_mode str

The LockMode of the ADB cluster.

lock_reason str
maintain_time str
mode str
network_type str

The DBClusterNetworkType of the ADB cluster.

payment_type str
port int
rds_instance_id str
region_id str

Region ID the cluster belongs to.

renewal_status str
resource_group_id str
security_ips Sequence[str]
status str

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

storage_resource str
tags Mapping[str, Any]

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
vpc_cloud_instance_id str
vpc_id str

ID of the VPC the cluster belongs to.

vswitch_id str
zone_id str

The ZoneId of the ADB cluster.

autoRenewPeriod Number
chargeType String

Billing method. Value options: PostPaid for Pay-As-You-Go and PrePaid for subscription.

commodityCode String
computeResource String
connectionString String
createTime String

The CreateTime of the ADB cluster.

dbClusterCategory String
dbClusterId String
dbClusterNetworkType String
dbClusterType String
dbClusterVersion String
dbNodeClass String

The DBNodeClass of the ADB cluster.

dbNodeCount Number

The DBNodeCount of the ADB cluster.

dbNodeStorage Number

The DBNodeStorage of the ADB cluster.

description String

The description of the ADB cluster.

diskType String
dtsJobId String
elasticIoResource Number
engine String
engineVersion String
executorCount String
expireTime String

Expiration time. Pay-As-You-Go clusters never expire.

expired String

The expired of the ADB cluster.

id String

The ID of the ADB cluster.

lockMode String

The LockMode of the ADB cluster.

lockReason String
maintainTime String
mode String
networkType String

The DBClusterNetworkType of the ADB cluster.

paymentType String
port Number
rdsInstanceId String
regionId String

Region ID the cluster belongs to.

renewalStatus String
resourceGroupId String
securityIps List<String>
status String

The status of the cluster. Valid values: Preparing, Creating, Restoring, Running, Deleting, ClassChanging, NetAddressCreating, NetAddressDeleting. For more information, see Cluster status.

storageResource String
tags Map<Any>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
vpcCloudInstanceId String
vpcId String

ID of the VPC the cluster belongs to.

vswitchId String
zoneId String

The ZoneId of the ADB cluster.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.