/
getClusters.go
75 lines (70 loc) · 2.22 KB
/
getClusters.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package edas
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// 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
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/edas"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "clusters.txt"
// _, err := edas.GetClusters(ctx, &edas.GetClustersArgs{
// LogicalRegionId: "cn-shenzhen:xxx",
// Ids: []string{
// "addfs-dfsasd",
// },
// OutputFile: &opt0,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("firstClusterName", data.Alicloud_alikafka_consumer_groups.Clusters.Clusters[0].Cluster_name)
// return nil
// })
// }
// ```
func GetClusters(ctx *pulumi.Context, args *GetClustersArgs, opts ...pulumi.InvokeOption) (*GetClustersResult, error) {
var rv GetClustersResult
err := ctx.Invoke("alicloud:edas/getClusters:getClusters", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getClusters.
type GetClustersArgs struct {
// An ids string to filter results by the cluster id.
Ids []string `pulumi:"ids"`
// ID of the namespace in EDAS.
LogicalRegionId string `pulumi:"logicalRegionId"`
// A regex string to filter results by the cluster name.
NameRegex *string `pulumi:"nameRegex"`
OutputFile *string `pulumi:"outputFile"`
}
// A collection of values returned by getClusters.
type GetClustersResult struct {
// A list of clusters.
Clusters []GetClustersCluster `pulumi:"clusters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A list of cluster IDs.
Ids []string `pulumi:"ids"`
LogicalRegionId string `pulumi:"logicalRegionId"`
NameRegex *string `pulumi:"nameRegex"`
// A list of cluster names.
Names []string `pulumi:"names"`
OutputFile *string `pulumi:"outputFile"`
}