getClusters

This data source provides a list of MSE Clusters in an Alibaba Cloud account according to the specified filters.

NOTE: Available in v1.94.0+.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
// Declare the data source
const example = alicloud.mse.getClusters({
ids: ["mse-cn-0d9xxxx"],
status: "INIT_SUCCESS",
});
export const clusterId = example.then(example => example.clusters?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
# Declare the data source
example = alicloud.mse.get_clusters(ids=["mse-cn-0d9xxxx"],
status="INIT_SUCCESS")
pulumi.export("clusterId", example.clusters[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
// Declare the data source
var example = AliCloud.Mse.GetClusters.Invoke(new()
{
Ids = new[]
{
"mse-cn-0d9xxxx",
},
Status = "INIT_SUCCESS",
});
return new Dictionary<string, object?>
{
["clusterId"] = example&#46;Apply(getClustersResult => getClustersResult&#46;Clusters[0]?.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mse"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Declare the data source
example, err := mse.GetClusters(ctx, &mse.GetClustersArgs{
Ids: []string{
"mse-cn-0d9xxxx",
},
Status: pulumi.StringRef("INIT_SUCCESS"),
}, nil)
if err != nil {
return err
}
ctx.Export("clusterId", example.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.mse.MseFunctions;
import com.pulumi.alicloud.mse.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) {
// Declare the data source
final var example = MseFunctions.getClusters(GetClustersArgs.builder()
.ids("mse-cn-0d9xxxx")
.status("INIT_SUCCESS")
.build());
ctx.export("clusterId", example.applyValue(getClustersResult -> getClustersResult.clusters()[0].id()));
}
}
variables:
# Declare the data source
example:
fn::invoke:
Function: alicloud:mse:getClusters
Arguments:
ids:
- mse-cn-0d9xxxx
status: INIT_SUCCESS
outputs:
clusterId: ${example.clusters[0].id}

Return

A collection of values returned by getClusters.

Parameters

argument

A collection of arguments for invoking getClusters.


suspend fun getClusters(clusterAliasName: String? = null, enableDetails: Boolean? = null, ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, requestPars: String? = null, status: String? = null): GetClustersResult

Return

A collection of values returned by getClusters.

Parameters

clusterAliasName

The alias name of MSE Cluster.

enableDetails
ids

A list of MSE Cluster ids.

nameRegex

A regex string to filter the results by the cluster alias name.

outputFile

File name where to save data source results (after running pulumi preview).

requestPars
status

The status of MSE Cluster. Valid: DESTROY_FAILED, DESTROY_ING, DESTROY_SUCCESS, INIT_FAILED, INIT_ING, INIT_SUCCESS, INIT_TIME_OUT, RESTART_FAILED, RESTART_ING, RESTART_SUCCESS, SCALE_FAILED, SCALE_ING, SCALE_SUCCESS

See also


suspend fun getClusters(argument: suspend GetClustersPlainArgsBuilder.() -> Unit): GetClustersResult

Return

A collection of values returned by getClusters.

Parameters

argument

Builder for com.pulumi.alicloud.mse.kotlin.inputs.GetClustersPlainArgs.

See also