generated from pulumi/pulumi-tf-provider-boilerplate
/
getMdbPostgresqlCluster.go
244 lines (211 loc) · 11.2 KB
/
getMdbPostgresqlCluster.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package yandex
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get information about a Yandex Managed PostgreSQL cluster. For more information, see
// [the official documentation](https://cloud.yandex.com/docs/managed-postgresql/).
// [How to connect to the DB](https://cloud.yandex.com/en-ru/docs/managed-postgresql/quickstart#connect). To connect, use port 6432. The port number is not configurable.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-yandex/sdk/go/yandex"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// foo, err := yandex.LookupMdbPostgresqlCluster(ctx, &GetMdbPostgresqlClusterArgs{
// Name: pulumi.StringRef("test"),
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("fqdn", foo.Hosts[0].Fqdn)
// return nil
// })
// }
//
// ```
func LookupMdbPostgresqlCluster(ctx *pulumi.Context, args *LookupMdbPostgresqlClusterArgs, opts ...pulumi.InvokeOption) (*LookupMdbPostgresqlClusterResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv LookupMdbPostgresqlClusterResult
err := ctx.Invoke("yandex:index/getMdbPostgresqlCluster:getMdbPostgresqlCluster", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getMdbPostgresqlCluster.
type LookupMdbPostgresqlClusterArgs struct {
// The ID of the PostgreSQL cluster.
ClusterId *string `pulumi:"clusterId"`
DeletionProtection *bool `pulumi:"deletionProtection"`
// Description of the PostgreSQL cluster.
Description *string `pulumi:"description"`
// The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
FolderId *string `pulumi:"folderId"`
// The name of the PostgreSQL cluster.
Name *string `pulumi:"name"`
}
// A collection of values returned by getMdbPostgresqlCluster.
type LookupMdbPostgresqlClusterResult struct {
ClusterId string `pulumi:"clusterId"`
// Configuration of the PostgreSQL cluster. The structure is documented below.
Configs []GetMdbPostgresqlClusterConfig `pulumi:"configs"`
// Timestamp of cluster creation.
CreatedAt string `pulumi:"createdAt"`
// List of all databases of the PostgreSQL cluster. The structure is documented below.
Databases []GetMdbPostgresqlClusterDatabase `pulumi:"databases"`
DeletionProtection bool `pulumi:"deletionProtection"`
// Description of the PostgreSQL cluster.
Description *string `pulumi:"description"`
// Deployment environment of the PostgreSQL cluster.
Environment string `pulumi:"environment"`
FolderId string `pulumi:"folderId"`
// Aggregated health of the cluster.
Health string `pulumi:"health"`
HostGroupIds []string `pulumi:"hostGroupIds"`
// List of all hosts of the PostgreSQL cluster. The structure is documented below.
Hosts []GetMdbPostgresqlClusterHost `pulumi:"hosts"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A set of key/value label pairs to assign to the PostgreSQL cluster.
Labels map[string]string `pulumi:"labels"`
// Maintenance window settings of the PostgreSQL cluster. The structure is documented below.
MaintenanceWindows []GetMdbPostgresqlClusterMaintenanceWindow `pulumi:"maintenanceWindows"`
// Name of the database extension. For more information on available extensions see [the official documentation](https://cloud.yandex.com/docs/managed-postgresql/operations/cluster-extensions).
Name string `pulumi:"name"`
// ID of the network, to which the PostgreSQL cluster belongs.
NetworkId string `pulumi:"networkId"`
// A set of ids of security groups assigned to hosts of the cluster.
SecurityGroupIds []string `pulumi:"securityGroupIds"`
// Status of the cluster.
Status string `pulumi:"status"`
// List of all users of the PostgreSQL cluster. The structure is documented below.
Users []GetMdbPostgresqlClusterUser `pulumi:"users"`
}
func LookupMdbPostgresqlClusterOutput(ctx *pulumi.Context, args LookupMdbPostgresqlClusterOutputArgs, opts ...pulumi.InvokeOption) LookupMdbPostgresqlClusterResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupMdbPostgresqlClusterResult, error) {
args := v.(LookupMdbPostgresqlClusterArgs)
r, err := LookupMdbPostgresqlCluster(ctx, &args, opts...)
var s LookupMdbPostgresqlClusterResult
if r != nil {
s = *r
}
return s, err
}).(LookupMdbPostgresqlClusterResultOutput)
}
// A collection of arguments for invoking getMdbPostgresqlCluster.
type LookupMdbPostgresqlClusterOutputArgs struct {
// The ID of the PostgreSQL cluster.
ClusterId pulumi.StringPtrInput `pulumi:"clusterId"`
DeletionProtection pulumi.BoolPtrInput `pulumi:"deletionProtection"`
// Description of the PostgreSQL cluster.
Description pulumi.StringPtrInput `pulumi:"description"`
// The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
FolderId pulumi.StringPtrInput `pulumi:"folderId"`
// The name of the PostgreSQL cluster.
Name pulumi.StringPtrInput `pulumi:"name"`
}
func (LookupMdbPostgresqlClusterOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupMdbPostgresqlClusterArgs)(nil)).Elem()
}
// A collection of values returned by getMdbPostgresqlCluster.
type LookupMdbPostgresqlClusterResultOutput struct{ *pulumi.OutputState }
func (LookupMdbPostgresqlClusterResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupMdbPostgresqlClusterResult)(nil)).Elem()
}
func (o LookupMdbPostgresqlClusterResultOutput) ToLookupMdbPostgresqlClusterResultOutput() LookupMdbPostgresqlClusterResultOutput {
return o
}
func (o LookupMdbPostgresqlClusterResultOutput) ToLookupMdbPostgresqlClusterResultOutputWithContext(ctx context.Context) LookupMdbPostgresqlClusterResultOutput {
return o
}
func (o LookupMdbPostgresqlClusterResultOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) string { return v.ClusterId }).(pulumi.StringOutput)
}
// Configuration of the PostgreSQL cluster. The structure is documented below.
func (o LookupMdbPostgresqlClusterResultOutput) Configs() GetMdbPostgresqlClusterConfigArrayOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) []GetMdbPostgresqlClusterConfig { return v.Configs }).(GetMdbPostgresqlClusterConfigArrayOutput)
}
// Timestamp of cluster creation.
func (o LookupMdbPostgresqlClusterResultOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) string { return v.CreatedAt }).(pulumi.StringOutput)
}
// List of all databases of the PostgreSQL cluster. The structure is documented below.
func (o LookupMdbPostgresqlClusterResultOutput) Databases() GetMdbPostgresqlClusterDatabaseArrayOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) []GetMdbPostgresqlClusterDatabase { return v.Databases }).(GetMdbPostgresqlClusterDatabaseArrayOutput)
}
func (o LookupMdbPostgresqlClusterResultOutput) DeletionProtection() pulumi.BoolOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) bool { return v.DeletionProtection }).(pulumi.BoolOutput)
}
// Description of the PostgreSQL cluster.
func (o LookupMdbPostgresqlClusterResultOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) *string { return v.Description }).(pulumi.StringPtrOutput)
}
// Deployment environment of the PostgreSQL cluster.
func (o LookupMdbPostgresqlClusterResultOutput) Environment() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) string { return v.Environment }).(pulumi.StringOutput)
}
func (o LookupMdbPostgresqlClusterResultOutput) FolderId() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) string { return v.FolderId }).(pulumi.StringOutput)
}
// Aggregated health of the cluster.
func (o LookupMdbPostgresqlClusterResultOutput) Health() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) string { return v.Health }).(pulumi.StringOutput)
}
func (o LookupMdbPostgresqlClusterResultOutput) HostGroupIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) []string { return v.HostGroupIds }).(pulumi.StringArrayOutput)
}
// List of all hosts of the PostgreSQL cluster. The structure is documented below.
func (o LookupMdbPostgresqlClusterResultOutput) Hosts() GetMdbPostgresqlClusterHostArrayOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) []GetMdbPostgresqlClusterHost { return v.Hosts }).(GetMdbPostgresqlClusterHostArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupMdbPostgresqlClusterResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) string { return v.Id }).(pulumi.StringOutput)
}
// A set of key/value label pairs to assign to the PostgreSQL cluster.
func (o LookupMdbPostgresqlClusterResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// Maintenance window settings of the PostgreSQL cluster. The structure is documented below.
func (o LookupMdbPostgresqlClusterResultOutput) MaintenanceWindows() GetMdbPostgresqlClusterMaintenanceWindowArrayOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) []GetMdbPostgresqlClusterMaintenanceWindow {
return v.MaintenanceWindows
}).(GetMdbPostgresqlClusterMaintenanceWindowArrayOutput)
}
// Name of the database extension. For more information on available extensions see [the official documentation](https://cloud.yandex.com/docs/managed-postgresql/operations/cluster-extensions).
func (o LookupMdbPostgresqlClusterResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) string { return v.Name }).(pulumi.StringOutput)
}
// ID of the network, to which the PostgreSQL cluster belongs.
func (o LookupMdbPostgresqlClusterResultOutput) NetworkId() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) string { return v.NetworkId }).(pulumi.StringOutput)
}
// A set of ids of security groups assigned to hosts of the cluster.
func (o LookupMdbPostgresqlClusterResultOutput) SecurityGroupIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)
}
// Status of the cluster.
func (o LookupMdbPostgresqlClusterResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) string { return v.Status }).(pulumi.StringOutput)
}
// List of all users of the PostgreSQL cluster. The structure is documented below.
func (o LookupMdbPostgresqlClusterResultOutput) Users() GetMdbPostgresqlClusterUserArrayOutput {
return o.ApplyT(func(v LookupMdbPostgresqlClusterResult) []GetMdbPostgresqlClusterUser { return v.Users }).(GetMdbPostgresqlClusterUserArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupMdbPostgresqlClusterResultOutput{})
}