get Clusters
This data source provides a list of EDAS clusters in an Alibaba Cloud account according to the specified filters.
NOTE: Available in 1.82.0+
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const clusters = alicloud.edas.getClusters({
logicalRegionId: "cn-shenzhen:xxx",
ids: ["addfs-dfsasd"],
outputFile: "clusters.txt",
});
export const firstClusterName = clustersAlicloudAlikafkaConsumerGroups.clusters[0].clusterName;Content copied to clipboard
import pulumi
import pulumi_alicloud as alicloud
clusters = alicloud.edas.get_clusters(logical_region_id="cn-shenzhen:xxx",
ids=["addfs-dfsasd"],
output_file="clusters.txt")
pulumi.export("firstClusterName", clusters_alicloud_alikafka_consumer_groups["clusters"][0]["clusterName"])Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var clusters = AliCloud.Edas.GetClusters.Invoke(new()
{
LogicalRegionId = "cn-shenzhen:xxx",
Ids = new[]
{
"addfs-dfsasd",
},
OutputFile = "clusters.txt",
});
return new Dictionary<string, object?>
{
["firstClusterName"] = clustersAlicloudAlikafkaConsumerGroups.Clusters[0].ClusterName,
};
});Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/edas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := edas.GetClusters(ctx, &edas.GetClustersArgs{
LogicalRegionId: "cn-shenzhen:xxx",
Ids: []string{
"addfs-dfsasd",
},
OutputFile: pulumi.StringRef("clusters.txt"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstClusterName", clustersAlicloudAlikafkaConsumerGroups.Clusters[0].ClusterName)
return nil
})
}Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.edas.EdasFunctions;
import com.pulumi.alicloud.edas.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 clusters = EdasFunctions.getClusters(GetClustersArgs.builder()
.logicalRegionId("cn-shenzhen:xxx")
.ids("addfs-dfsasd")
.outputFile("clusters.txt")
.build());
ctx.export("firstClusterName", clustersAlicloudAlikafkaConsumerGroups.clusters()[0].clusterName());
}
}Content copied to clipboard
variables:
clusters:
fn::invoke:
Function: alicloud:edas:getClusters
Arguments:
logicalRegionId: cn-shenzhen:xxx
ids:
- addfs-dfsasd
outputFile: clusters.txt
outputs:
firstClusterName: ${clustersAlicloudAlikafkaConsumerGroups.clusters[0].clusterName}Content copied to clipboard
Return
A collection of values returned by getClusters.
Parameters
argument
A collection of arguments for invoking getClusters.
suspend fun getClusters(ids: List<String>? = null, logicalRegionId: String, nameRegex: String? = null, outputFile: String? = null): GetClustersResult
Return
A collection of values returned by getClusters.
See also
Parameters
ids
An ids string to filter results by the cluster id.
logical Region Id
ID of the namespace in EDAS.
name Regex
A regex string to filter results by the cluster name.
output File
File name where to save data source results (after running pulumi preview).
suspend fun getClusters(argument: suspend GetClustersPlainArgsBuilder.() -> Unit): GetClustersResult
Return
A collection of values returned by getClusters.
See also
Parameters
argument
Builder for com.pulumi.alicloud.edas.kotlin.inputs.GetClustersPlainArgs.