generated from pulumi/pulumi-tf-provider-boilerplate
/
getMdbMongodbCluster.go
351 lines (312 loc) · 17.1 KB
/
getMdbMongodbCluster.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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
// 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 MongoDB cluster. For more information, see
// [the official documentation](https://cloud.yandex.com/docs/managed-mongodb/concepts).
//
// ## 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.LookupMdbMongodbCluster(ctx, &GetMdbMongodbClusterArgs{
// Name: pulumi.StringRef("test"),
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("networkId", foo.NetworkId)
// return nil
// })
// }
//
// ```
func LookupMdbMongodbCluster(ctx *pulumi.Context, args *LookupMdbMongodbClusterArgs, opts ...pulumi.InvokeOption) (*LookupMdbMongodbClusterResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv LookupMdbMongodbClusterResult
err := ctx.Invoke("yandex:index/getMdbMongodbCluster:getMdbMongodbCluster", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getMdbMongodbCluster.
type LookupMdbMongodbClusterArgs struct {
// Configuration of the MongoDB cluster. The structure is documented below.
ClusterConfig *GetMdbMongodbClusterClusterConfig `pulumi:"clusterConfig"`
// The ID of the MongoDB cluster.
ClusterId *string `pulumi:"clusterId"`
// Creation timestamp of the key.
CreatedAt *string `pulumi:"createdAt"`
// A database of the MongoDB cluster. The structure is documented below.
Databases []GetMdbMongodbClusterDatabase `pulumi:"databases"`
DeletionProtection *bool `pulumi:"deletionProtection"`
// Description of the MongoDB cluster.
Description *string `pulumi:"description"`
// Deployment environment of the MongoDB cluster.
Environment *string `pulumi:"environment"`
// Folder that the resource belongs to. If value is omitted, the default provider folder is used.
FolderId *string `pulumi:"folderId"`
// The health of the host.
Health *string `pulumi:"health"`
// A host of the MongoDB cluster. The structure is documented below.
Hosts []GetMdbMongodbClusterHost `pulumi:"hosts"`
// A set of key/value label pairs to assign to the MongoDB cluster.
Labels map[string]string `pulumi:"labels"`
MaintenanceWindow *GetMdbMongodbClusterMaintenanceWindow `pulumi:"maintenanceWindow"`
// The name of the MongoDB cluster.
Name *string `pulumi:"name"`
// ID of the network, to which the MongoDB cluster belongs.
NetworkId *string `pulumi:"networkId"`
// Resources allocated to hosts of the MongoDB cluster. The structure is documented below.
//
// Deprecated: to manage `resources`s, please switch to using a separate resource type `resources_mongo*`
Resources *GetMdbMongodbClusterResources `pulumi:"resources"`
ResourcesMongocfg *GetMdbMongodbClusterResourcesMongocfg `pulumi:"resourcesMongocfg"`
ResourcesMongod *GetMdbMongodbClusterResourcesMongod `pulumi:"resourcesMongod"`
ResourcesMongoinfra *GetMdbMongodbClusterResourcesMongoinfra `pulumi:"resourcesMongoinfra"`
ResourcesMongos *GetMdbMongodbClusterResourcesMongos `pulumi:"resourcesMongos"`
Restore *GetMdbMongodbClusterRestore `pulumi:"restore"`
// A set of ids of security groups assigned to hosts of the cluster.
SecurityGroupIds []string `pulumi:"securityGroupIds"`
// MongoDB Cluster mode enabled/disabled.
Sharded *bool `pulumi:"sharded"`
// Status of the cluster.
Status *string `pulumi:"status"`
// A user of the MongoDB cluster. The structure is documented below.
Users []GetMdbMongodbClusterUser `pulumi:"users"`
}
// A collection of values returned by getMdbMongodbCluster.
type LookupMdbMongodbClusterResult struct {
// Configuration of the MongoDB cluster. The structure is documented below.
ClusterConfig *GetMdbMongodbClusterClusterConfig `pulumi:"clusterConfig"`
ClusterId string `pulumi:"clusterId"`
// Creation timestamp of the key.
CreatedAt string `pulumi:"createdAt"`
// A database of the MongoDB cluster. The structure is documented below.
Databases []GetMdbMongodbClusterDatabase `pulumi:"databases"`
DeletionProtection bool `pulumi:"deletionProtection"`
// Description of the MongoDB cluster.
Description *string `pulumi:"description"`
// Deployment environment of the MongoDB cluster.
Environment *string `pulumi:"environment"`
FolderId string `pulumi:"folderId"`
// The health of the host.
Health string `pulumi:"health"`
// A host of the MongoDB cluster. The structure is documented below.
Hosts []GetMdbMongodbClusterHost `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 MongoDB cluster.
Labels map[string]string `pulumi:"labels"`
MaintenanceWindow GetMdbMongodbClusterMaintenanceWindow `pulumi:"maintenanceWindow"`
// The name of the database.
Name *string `pulumi:"name"`
// ID of the network, to which the MongoDB cluster belongs.
NetworkId *string `pulumi:"networkId"`
// Resources allocated to hosts of the MongoDB cluster. The structure is documented below.
//
// Deprecated: to manage `resources`s, please switch to using a separate resource type `resources_mongo*`
Resources *GetMdbMongodbClusterResources `pulumi:"resources"`
ResourcesMongocfg *GetMdbMongodbClusterResourcesMongocfg `pulumi:"resourcesMongocfg"`
ResourcesMongod *GetMdbMongodbClusterResourcesMongod `pulumi:"resourcesMongod"`
ResourcesMongoinfra *GetMdbMongodbClusterResourcesMongoinfra `pulumi:"resourcesMongoinfra"`
ResourcesMongos *GetMdbMongodbClusterResourcesMongos `pulumi:"resourcesMongos"`
Restore *GetMdbMongodbClusterRestore `pulumi:"restore"`
// A set of ids of security groups assigned to hosts of the cluster.
SecurityGroupIds []string `pulumi:"securityGroupIds"`
// MongoDB Cluster mode enabled/disabled.
Sharded bool `pulumi:"sharded"`
// Status of the cluster.
Status string `pulumi:"status"`
// A user of the MongoDB cluster. The structure is documented below.
Users []GetMdbMongodbClusterUser `pulumi:"users"`
}
func LookupMdbMongodbClusterOutput(ctx *pulumi.Context, args LookupMdbMongodbClusterOutputArgs, opts ...pulumi.InvokeOption) LookupMdbMongodbClusterResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupMdbMongodbClusterResult, error) {
args := v.(LookupMdbMongodbClusterArgs)
r, err := LookupMdbMongodbCluster(ctx, &args, opts...)
var s LookupMdbMongodbClusterResult
if r != nil {
s = *r
}
return s, err
}).(LookupMdbMongodbClusterResultOutput)
}
// A collection of arguments for invoking getMdbMongodbCluster.
type LookupMdbMongodbClusterOutputArgs struct {
// Configuration of the MongoDB cluster. The structure is documented below.
ClusterConfig GetMdbMongodbClusterClusterConfigPtrInput `pulumi:"clusterConfig"`
// The ID of the MongoDB cluster.
ClusterId pulumi.StringPtrInput `pulumi:"clusterId"`
// Creation timestamp of the key.
CreatedAt pulumi.StringPtrInput `pulumi:"createdAt"`
// A database of the MongoDB cluster. The structure is documented below.
Databases GetMdbMongodbClusterDatabaseArrayInput `pulumi:"databases"`
DeletionProtection pulumi.BoolPtrInput `pulumi:"deletionProtection"`
// Description of the MongoDB cluster.
Description pulumi.StringPtrInput `pulumi:"description"`
// Deployment environment of the MongoDB cluster.
Environment pulumi.StringPtrInput `pulumi:"environment"`
// Folder that the resource belongs to. If value is omitted, the default provider folder is used.
FolderId pulumi.StringPtrInput `pulumi:"folderId"`
// The health of the host.
Health pulumi.StringPtrInput `pulumi:"health"`
// A host of the MongoDB cluster. The structure is documented below.
Hosts GetMdbMongodbClusterHostArrayInput `pulumi:"hosts"`
// A set of key/value label pairs to assign to the MongoDB cluster.
Labels pulumi.StringMapInput `pulumi:"labels"`
MaintenanceWindow GetMdbMongodbClusterMaintenanceWindowPtrInput `pulumi:"maintenanceWindow"`
// The name of the MongoDB cluster.
Name pulumi.StringPtrInput `pulumi:"name"`
// ID of the network, to which the MongoDB cluster belongs.
NetworkId pulumi.StringPtrInput `pulumi:"networkId"`
// Resources allocated to hosts of the MongoDB cluster. The structure is documented below.
//
// Deprecated: to manage `resources`s, please switch to using a separate resource type `resources_mongo*`
Resources GetMdbMongodbClusterResourcesPtrInput `pulumi:"resources"`
ResourcesMongocfg GetMdbMongodbClusterResourcesMongocfgPtrInput `pulumi:"resourcesMongocfg"`
ResourcesMongod GetMdbMongodbClusterResourcesMongodPtrInput `pulumi:"resourcesMongod"`
ResourcesMongoinfra GetMdbMongodbClusterResourcesMongoinfraPtrInput `pulumi:"resourcesMongoinfra"`
ResourcesMongos GetMdbMongodbClusterResourcesMongosPtrInput `pulumi:"resourcesMongos"`
Restore GetMdbMongodbClusterRestorePtrInput `pulumi:"restore"`
// A set of ids of security groups assigned to hosts of the cluster.
SecurityGroupIds pulumi.StringArrayInput `pulumi:"securityGroupIds"`
// MongoDB Cluster mode enabled/disabled.
Sharded pulumi.BoolPtrInput `pulumi:"sharded"`
// Status of the cluster.
Status pulumi.StringPtrInput `pulumi:"status"`
// A user of the MongoDB cluster. The structure is documented below.
Users GetMdbMongodbClusterUserArrayInput `pulumi:"users"`
}
func (LookupMdbMongodbClusterOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupMdbMongodbClusterArgs)(nil)).Elem()
}
// A collection of values returned by getMdbMongodbCluster.
type LookupMdbMongodbClusterResultOutput struct{ *pulumi.OutputState }
func (LookupMdbMongodbClusterResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupMdbMongodbClusterResult)(nil)).Elem()
}
func (o LookupMdbMongodbClusterResultOutput) ToLookupMdbMongodbClusterResultOutput() LookupMdbMongodbClusterResultOutput {
return o
}
func (o LookupMdbMongodbClusterResultOutput) ToLookupMdbMongodbClusterResultOutputWithContext(ctx context.Context) LookupMdbMongodbClusterResultOutput {
return o
}
// Configuration of the MongoDB cluster. The structure is documented below.
func (o LookupMdbMongodbClusterResultOutput) ClusterConfig() GetMdbMongodbClusterClusterConfigPtrOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) *GetMdbMongodbClusterClusterConfig { return v.ClusterConfig }).(GetMdbMongodbClusterClusterConfigPtrOutput)
}
func (o LookupMdbMongodbClusterResultOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) string { return v.ClusterId }).(pulumi.StringOutput)
}
// Creation timestamp of the key.
func (o LookupMdbMongodbClusterResultOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) string { return v.CreatedAt }).(pulumi.StringOutput)
}
// A database of the MongoDB cluster. The structure is documented below.
func (o LookupMdbMongodbClusterResultOutput) Databases() GetMdbMongodbClusterDatabaseArrayOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) []GetMdbMongodbClusterDatabase { return v.Databases }).(GetMdbMongodbClusterDatabaseArrayOutput)
}
func (o LookupMdbMongodbClusterResultOutput) DeletionProtection() pulumi.BoolOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) bool { return v.DeletionProtection }).(pulumi.BoolOutput)
}
// Description of the MongoDB cluster.
func (o LookupMdbMongodbClusterResultOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) *string { return v.Description }).(pulumi.StringPtrOutput)
}
// Deployment environment of the MongoDB cluster.
func (o LookupMdbMongodbClusterResultOutput) Environment() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) *string { return v.Environment }).(pulumi.StringPtrOutput)
}
func (o LookupMdbMongodbClusterResultOutput) FolderId() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) string { return v.FolderId }).(pulumi.StringOutput)
}
// The health of the host.
func (o LookupMdbMongodbClusterResultOutput) Health() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) string { return v.Health }).(pulumi.StringOutput)
}
// A host of the MongoDB cluster. The structure is documented below.
func (o LookupMdbMongodbClusterResultOutput) Hosts() GetMdbMongodbClusterHostArrayOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) []GetMdbMongodbClusterHost { return v.Hosts }).(GetMdbMongodbClusterHostArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupMdbMongodbClusterResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) string { return v.Id }).(pulumi.StringOutput)
}
// A set of key/value label pairs to assign to the MongoDB cluster.
func (o LookupMdbMongodbClusterResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
func (o LookupMdbMongodbClusterResultOutput) MaintenanceWindow() GetMdbMongodbClusterMaintenanceWindowOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) GetMdbMongodbClusterMaintenanceWindow {
return v.MaintenanceWindow
}).(GetMdbMongodbClusterMaintenanceWindowOutput)
}
// The name of the database.
func (o LookupMdbMongodbClusterResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
// ID of the network, to which the MongoDB cluster belongs.
func (o LookupMdbMongodbClusterResultOutput) NetworkId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) *string { return v.NetworkId }).(pulumi.StringPtrOutput)
}
// Resources allocated to hosts of the MongoDB cluster. The structure is documented below.
//
// Deprecated: to manage `resources`s, please switch to using a separate resource type `resources_mongo*`
func (o LookupMdbMongodbClusterResultOutput) Resources() GetMdbMongodbClusterResourcesPtrOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) *GetMdbMongodbClusterResources { return v.Resources }).(GetMdbMongodbClusterResourcesPtrOutput)
}
func (o LookupMdbMongodbClusterResultOutput) ResourcesMongocfg() GetMdbMongodbClusterResourcesMongocfgPtrOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) *GetMdbMongodbClusterResourcesMongocfg {
return v.ResourcesMongocfg
}).(GetMdbMongodbClusterResourcesMongocfgPtrOutput)
}
func (o LookupMdbMongodbClusterResultOutput) ResourcesMongod() GetMdbMongodbClusterResourcesMongodPtrOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) *GetMdbMongodbClusterResourcesMongod { return v.ResourcesMongod }).(GetMdbMongodbClusterResourcesMongodPtrOutput)
}
func (o LookupMdbMongodbClusterResultOutput) ResourcesMongoinfra() GetMdbMongodbClusterResourcesMongoinfraPtrOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) *GetMdbMongodbClusterResourcesMongoinfra {
return v.ResourcesMongoinfra
}).(GetMdbMongodbClusterResourcesMongoinfraPtrOutput)
}
func (o LookupMdbMongodbClusterResultOutput) ResourcesMongos() GetMdbMongodbClusterResourcesMongosPtrOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) *GetMdbMongodbClusterResourcesMongos { return v.ResourcesMongos }).(GetMdbMongodbClusterResourcesMongosPtrOutput)
}
func (o LookupMdbMongodbClusterResultOutput) Restore() GetMdbMongodbClusterRestorePtrOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) *GetMdbMongodbClusterRestore { return v.Restore }).(GetMdbMongodbClusterRestorePtrOutput)
}
// A set of ids of security groups assigned to hosts of the cluster.
func (o LookupMdbMongodbClusterResultOutput) SecurityGroupIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)
}
// MongoDB Cluster mode enabled/disabled.
func (o LookupMdbMongodbClusterResultOutput) Sharded() pulumi.BoolOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) bool { return v.Sharded }).(pulumi.BoolOutput)
}
// Status of the cluster.
func (o LookupMdbMongodbClusterResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) string { return v.Status }).(pulumi.StringOutput)
}
// A user of the MongoDB cluster. The structure is documented below.
func (o LookupMdbMongodbClusterResultOutput) Users() GetMdbMongodbClusterUserArrayOutput {
return o.ApplyT(func(v LookupMdbMongodbClusterResult) []GetMdbMongodbClusterUser { return v.Users }).(GetMdbMongodbClusterUserArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupMdbMongodbClusterResultOutput{})
}