-
Notifications
You must be signed in to change notification settings - Fork 5
/
getEndpoints.go
73 lines (68 loc) · 2.22 KB
/
getEndpoints.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
// *** 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 polardb
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// The `polardb.getEndpoints` data source provides a collection of PolarDB endpoints available in Alibaba Cloud account.
// Filters support regular expression for the cluster name, searches by clusterId, and other filters which are listed below.
//
// > **NOTE:** Available in v1.68.0+.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/polardb"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "pc-\\w+"
// opt1 := "Running"
// polardbClustersDs, err := polardb.GetClusters(ctx, &polardb.GetClustersArgs{
// DescriptionRegex: &opt0,
// Status: &opt1,
// }, nil)
// if err != nil {
// return err
// }
// _default, err := polardb.GetEndpoints(ctx, &polardb.GetEndpointsArgs{
// DbClusterId: polardbClustersDs.Clusters[0].Id,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("endpoint", _default.Endpoints[0].DbEndpointId)
// return nil
// })
// }
// ```
func GetEndpoints(ctx *pulumi.Context, args *GetEndpointsArgs, opts ...pulumi.InvokeOption) (*GetEndpointsResult, error) {
var rv GetEndpointsResult
err := ctx.Invoke("alicloud:polardb/getEndpoints:getEndpoints", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getEndpoints.
type GetEndpointsArgs struct {
// PolarDB cluster ID.
DbClusterId string `pulumi:"dbClusterId"`
// endpoint of the cluster.
DbEndpointId *string `pulumi:"dbEndpointId"`
}
// A collection of values returned by getEndpoints.
type GetEndpointsResult struct {
DbClusterId string `pulumi:"dbClusterId"`
// The endpoint ID.
DbEndpointId *string `pulumi:"dbEndpointId"`
// A list of PolarDB cluster endpoints. Each element contains the following attributes:
Endpoints []GetEndpointsEndpoint `pulumi:"endpoints"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
}