/
enterpriseDatabase.go
387 lines (327 loc) · 19.6 KB
/
enterpriseDatabase.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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
// *** 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 redis
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Manages a Redis Enterprise Database.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/redis"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleEnterpriseCluster, err := redis.NewEnterpriseCluster(ctx, "exampleEnterpriseCluster", &redis.EnterpriseClusterArgs{
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// SkuName: pulumi.String("Enterprise_E20-4"),
// })
// if err != nil {
// return err
// }
// _, err = redis.NewEnterpriseDatabase(ctx, "exampleEnterpriseDatabase", &redis.EnterpriseDatabaseArgs{
// ResourceGroupName: exampleResourceGroup.Name,
// ClusterId: exampleEnterpriseCluster.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Redis Enterprise Databases can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:redis/enterpriseDatabase:EnterpriseDatabase example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redisEnterprise/cluster1/databases/database1
// ```
type EnterpriseDatabase struct {
pulumi.CustomResourceState
// Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. Possible values are `Encrypted` and `Plaintext`. Defaults to `Encrypted`. Changing this forces a new Redis Enterprise Database to be created.
ClientProtocol pulumi.StringPtrOutput `pulumi:"clientProtocol"`
// The resource id of the Redis Enterprise Cluster to deploy this Redis Enterprise Database. Changing this forces a new Redis Enterprise Database to be created.
ClusterId pulumi.StringOutput `pulumi:"clusterId"`
// Clustering policy - default is OSSCluster. Specified at create time. Possible values are `EnterpriseCluster` and `OSSCluster`. Defaults to `OSSCluster`. Changing this forces a new Redis Enterprise Database to be created.
ClusteringPolicy pulumi.StringPtrOutput `pulumi:"clusteringPolicy"`
// Redis eviction policy - default is VolatileLRU. Possible values are `AllKeysLFU`, `AllKeysLRU`, `AllKeysRandom`, `VolatileLRU`, `VolatileLFU`, `VolatileTTL`, `VolatileRandom` and `NoEviction`. Defaults to `VolatileLRU`. Changing this forces a new Redis Enterprise Database to be created.
EvictionPolicy pulumi.StringPtrOutput `pulumi:"evictionPolicy"`
// A `module` block as defined below.
Modules EnterpriseDatabaseModuleArrayOutput `pulumi:"modules"`
// The name which should be used for this Redis Enterprise Database. Currently the acceptable value for this argument is `default`. Defaults to `default`. Changing this forces a new Redis Enterprise Database to be created.
Name pulumi.StringOutput `pulumi:"name"`
// TCP port of the database endpoint. Specified at create time. Defaults to an available port. Changing this forces a new Redis Enterprise Database to be created.
Port pulumi.IntPtrOutput `pulumi:"port"`
// The name of the Resource Group where the Redis Enterprise Database should exist. Changing this forces a new Redis Enterprise Database to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
}
// NewEnterpriseDatabase registers a new resource with the given unique name, arguments, and options.
func NewEnterpriseDatabase(ctx *pulumi.Context,
name string, args *EnterpriseDatabaseArgs, opts ...pulumi.ResourceOption) (*EnterpriseDatabase, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClusterId == nil {
return nil, errors.New("invalid value for required argument 'ClusterId'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
var resource EnterpriseDatabase
err := ctx.RegisterResource("azure:redis/enterpriseDatabase:EnterpriseDatabase", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEnterpriseDatabase gets an existing EnterpriseDatabase resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetEnterpriseDatabase(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EnterpriseDatabaseState, opts ...pulumi.ResourceOption) (*EnterpriseDatabase, error) {
var resource EnterpriseDatabase
err := ctx.ReadResource("azure:redis/enterpriseDatabase:EnterpriseDatabase", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EnterpriseDatabase resources.
type enterpriseDatabaseState struct {
// Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. Possible values are `Encrypted` and `Plaintext`. Defaults to `Encrypted`. Changing this forces a new Redis Enterprise Database to be created.
ClientProtocol *string `pulumi:"clientProtocol"`
// The resource id of the Redis Enterprise Cluster to deploy this Redis Enterprise Database. Changing this forces a new Redis Enterprise Database to be created.
ClusterId *string `pulumi:"clusterId"`
// Clustering policy - default is OSSCluster. Specified at create time. Possible values are `EnterpriseCluster` and `OSSCluster`. Defaults to `OSSCluster`. Changing this forces a new Redis Enterprise Database to be created.
ClusteringPolicy *string `pulumi:"clusteringPolicy"`
// Redis eviction policy - default is VolatileLRU. Possible values are `AllKeysLFU`, `AllKeysLRU`, `AllKeysRandom`, `VolatileLRU`, `VolatileLFU`, `VolatileTTL`, `VolatileRandom` and `NoEviction`. Defaults to `VolatileLRU`. Changing this forces a new Redis Enterprise Database to be created.
EvictionPolicy *string `pulumi:"evictionPolicy"`
// A `module` block as defined below.
Modules []EnterpriseDatabaseModule `pulumi:"modules"`
// The name which should be used for this Redis Enterprise Database. Currently the acceptable value for this argument is `default`. Defaults to `default`. Changing this forces a new Redis Enterprise Database to be created.
Name *string `pulumi:"name"`
// TCP port of the database endpoint. Specified at create time. Defaults to an available port. Changing this forces a new Redis Enterprise Database to be created.
Port *int `pulumi:"port"`
// The name of the Resource Group where the Redis Enterprise Database should exist. Changing this forces a new Redis Enterprise Database to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
}
type EnterpriseDatabaseState struct {
// Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. Possible values are `Encrypted` and `Plaintext`. Defaults to `Encrypted`. Changing this forces a new Redis Enterprise Database to be created.
ClientProtocol pulumi.StringPtrInput
// The resource id of the Redis Enterprise Cluster to deploy this Redis Enterprise Database. Changing this forces a new Redis Enterprise Database to be created.
ClusterId pulumi.StringPtrInput
// Clustering policy - default is OSSCluster. Specified at create time. Possible values are `EnterpriseCluster` and `OSSCluster`. Defaults to `OSSCluster`. Changing this forces a new Redis Enterprise Database to be created.
ClusteringPolicy pulumi.StringPtrInput
// Redis eviction policy - default is VolatileLRU. Possible values are `AllKeysLFU`, `AllKeysLRU`, `AllKeysRandom`, `VolatileLRU`, `VolatileLFU`, `VolatileTTL`, `VolatileRandom` and `NoEviction`. Defaults to `VolatileLRU`. Changing this forces a new Redis Enterprise Database to be created.
EvictionPolicy pulumi.StringPtrInput
// A `module` block as defined below.
Modules EnterpriseDatabaseModuleArrayInput
// The name which should be used for this Redis Enterprise Database. Currently the acceptable value for this argument is `default`. Defaults to `default`. Changing this forces a new Redis Enterprise Database to be created.
Name pulumi.StringPtrInput
// TCP port of the database endpoint. Specified at create time. Defaults to an available port. Changing this forces a new Redis Enterprise Database to be created.
Port pulumi.IntPtrInput
// The name of the Resource Group where the Redis Enterprise Database should exist. Changing this forces a new Redis Enterprise Database to be created.
ResourceGroupName pulumi.StringPtrInput
}
func (EnterpriseDatabaseState) ElementType() reflect.Type {
return reflect.TypeOf((*enterpriseDatabaseState)(nil)).Elem()
}
type enterpriseDatabaseArgs struct {
// Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. Possible values are `Encrypted` and `Plaintext`. Defaults to `Encrypted`. Changing this forces a new Redis Enterprise Database to be created.
ClientProtocol *string `pulumi:"clientProtocol"`
// The resource id of the Redis Enterprise Cluster to deploy this Redis Enterprise Database. Changing this forces a new Redis Enterprise Database to be created.
ClusterId string `pulumi:"clusterId"`
// Clustering policy - default is OSSCluster. Specified at create time. Possible values are `EnterpriseCluster` and `OSSCluster`. Defaults to `OSSCluster`. Changing this forces a new Redis Enterprise Database to be created.
ClusteringPolicy *string `pulumi:"clusteringPolicy"`
// Redis eviction policy - default is VolatileLRU. Possible values are `AllKeysLFU`, `AllKeysLRU`, `AllKeysRandom`, `VolatileLRU`, `VolatileLFU`, `VolatileTTL`, `VolatileRandom` and `NoEviction`. Defaults to `VolatileLRU`. Changing this forces a new Redis Enterprise Database to be created.
EvictionPolicy *string `pulumi:"evictionPolicy"`
// A `module` block as defined below.
Modules []EnterpriseDatabaseModule `pulumi:"modules"`
// The name which should be used for this Redis Enterprise Database. Currently the acceptable value for this argument is `default`. Defaults to `default`. Changing this forces a new Redis Enterprise Database to be created.
Name *string `pulumi:"name"`
// TCP port of the database endpoint. Specified at create time. Defaults to an available port. Changing this forces a new Redis Enterprise Database to be created.
Port *int `pulumi:"port"`
// The name of the Resource Group where the Redis Enterprise Database should exist. Changing this forces a new Redis Enterprise Database to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// The set of arguments for constructing a EnterpriseDatabase resource.
type EnterpriseDatabaseArgs struct {
// Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. Possible values are `Encrypted` and `Plaintext`. Defaults to `Encrypted`. Changing this forces a new Redis Enterprise Database to be created.
ClientProtocol pulumi.StringPtrInput
// The resource id of the Redis Enterprise Cluster to deploy this Redis Enterprise Database. Changing this forces a new Redis Enterprise Database to be created.
ClusterId pulumi.StringInput
// Clustering policy - default is OSSCluster. Specified at create time. Possible values are `EnterpriseCluster` and `OSSCluster`. Defaults to `OSSCluster`. Changing this forces a new Redis Enterprise Database to be created.
ClusteringPolicy pulumi.StringPtrInput
// Redis eviction policy - default is VolatileLRU. Possible values are `AllKeysLFU`, `AllKeysLRU`, `AllKeysRandom`, `VolatileLRU`, `VolatileLFU`, `VolatileTTL`, `VolatileRandom` and `NoEviction`. Defaults to `VolatileLRU`. Changing this forces a new Redis Enterprise Database to be created.
EvictionPolicy pulumi.StringPtrInput
// A `module` block as defined below.
Modules EnterpriseDatabaseModuleArrayInput
// The name which should be used for this Redis Enterprise Database. Currently the acceptable value for this argument is `default`. Defaults to `default`. Changing this forces a new Redis Enterprise Database to be created.
Name pulumi.StringPtrInput
// TCP port of the database endpoint. Specified at create time. Defaults to an available port. Changing this forces a new Redis Enterprise Database to be created.
Port pulumi.IntPtrInput
// The name of the Resource Group where the Redis Enterprise Database should exist. Changing this forces a new Redis Enterprise Database to be created.
ResourceGroupName pulumi.StringInput
}
func (EnterpriseDatabaseArgs) ElementType() reflect.Type {
return reflect.TypeOf((*enterpriseDatabaseArgs)(nil)).Elem()
}
type EnterpriseDatabaseInput interface {
pulumi.Input
ToEnterpriseDatabaseOutput() EnterpriseDatabaseOutput
ToEnterpriseDatabaseOutputWithContext(ctx context.Context) EnterpriseDatabaseOutput
}
func (*EnterpriseDatabase) ElementType() reflect.Type {
return reflect.TypeOf((*EnterpriseDatabase)(nil))
}
func (i *EnterpriseDatabase) ToEnterpriseDatabaseOutput() EnterpriseDatabaseOutput {
return i.ToEnterpriseDatabaseOutputWithContext(context.Background())
}
func (i *EnterpriseDatabase) ToEnterpriseDatabaseOutputWithContext(ctx context.Context) EnterpriseDatabaseOutput {
return pulumi.ToOutputWithContext(ctx, i).(EnterpriseDatabaseOutput)
}
func (i *EnterpriseDatabase) ToEnterpriseDatabasePtrOutput() EnterpriseDatabasePtrOutput {
return i.ToEnterpriseDatabasePtrOutputWithContext(context.Background())
}
func (i *EnterpriseDatabase) ToEnterpriseDatabasePtrOutputWithContext(ctx context.Context) EnterpriseDatabasePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(EnterpriseDatabasePtrOutput)
}
type EnterpriseDatabasePtrInput interface {
pulumi.Input
ToEnterpriseDatabasePtrOutput() EnterpriseDatabasePtrOutput
ToEnterpriseDatabasePtrOutputWithContext(ctx context.Context) EnterpriseDatabasePtrOutput
}
type enterpriseDatabasePtrType EnterpriseDatabaseArgs
func (*enterpriseDatabasePtrType) ElementType() reflect.Type {
return reflect.TypeOf((**EnterpriseDatabase)(nil))
}
func (i *enterpriseDatabasePtrType) ToEnterpriseDatabasePtrOutput() EnterpriseDatabasePtrOutput {
return i.ToEnterpriseDatabasePtrOutputWithContext(context.Background())
}
func (i *enterpriseDatabasePtrType) ToEnterpriseDatabasePtrOutputWithContext(ctx context.Context) EnterpriseDatabasePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(EnterpriseDatabasePtrOutput)
}
// EnterpriseDatabaseArrayInput is an input type that accepts EnterpriseDatabaseArray and EnterpriseDatabaseArrayOutput values.
// You can construct a concrete instance of `EnterpriseDatabaseArrayInput` via:
//
// EnterpriseDatabaseArray{ EnterpriseDatabaseArgs{...} }
type EnterpriseDatabaseArrayInput interface {
pulumi.Input
ToEnterpriseDatabaseArrayOutput() EnterpriseDatabaseArrayOutput
ToEnterpriseDatabaseArrayOutputWithContext(context.Context) EnterpriseDatabaseArrayOutput
}
type EnterpriseDatabaseArray []EnterpriseDatabaseInput
func (EnterpriseDatabaseArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*EnterpriseDatabase)(nil))
}
func (i EnterpriseDatabaseArray) ToEnterpriseDatabaseArrayOutput() EnterpriseDatabaseArrayOutput {
return i.ToEnterpriseDatabaseArrayOutputWithContext(context.Background())
}
func (i EnterpriseDatabaseArray) ToEnterpriseDatabaseArrayOutputWithContext(ctx context.Context) EnterpriseDatabaseArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(EnterpriseDatabaseArrayOutput)
}
// EnterpriseDatabaseMapInput is an input type that accepts EnterpriseDatabaseMap and EnterpriseDatabaseMapOutput values.
// You can construct a concrete instance of `EnterpriseDatabaseMapInput` via:
//
// EnterpriseDatabaseMap{ "key": EnterpriseDatabaseArgs{...} }
type EnterpriseDatabaseMapInput interface {
pulumi.Input
ToEnterpriseDatabaseMapOutput() EnterpriseDatabaseMapOutput
ToEnterpriseDatabaseMapOutputWithContext(context.Context) EnterpriseDatabaseMapOutput
}
type EnterpriseDatabaseMap map[string]EnterpriseDatabaseInput
func (EnterpriseDatabaseMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*EnterpriseDatabase)(nil))
}
func (i EnterpriseDatabaseMap) ToEnterpriseDatabaseMapOutput() EnterpriseDatabaseMapOutput {
return i.ToEnterpriseDatabaseMapOutputWithContext(context.Background())
}
func (i EnterpriseDatabaseMap) ToEnterpriseDatabaseMapOutputWithContext(ctx context.Context) EnterpriseDatabaseMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(EnterpriseDatabaseMapOutput)
}
type EnterpriseDatabaseOutput struct {
*pulumi.OutputState
}
func (EnterpriseDatabaseOutput) ElementType() reflect.Type {
return reflect.TypeOf((*EnterpriseDatabase)(nil))
}
func (o EnterpriseDatabaseOutput) ToEnterpriseDatabaseOutput() EnterpriseDatabaseOutput {
return o
}
func (o EnterpriseDatabaseOutput) ToEnterpriseDatabaseOutputWithContext(ctx context.Context) EnterpriseDatabaseOutput {
return o
}
func (o EnterpriseDatabaseOutput) ToEnterpriseDatabasePtrOutput() EnterpriseDatabasePtrOutput {
return o.ToEnterpriseDatabasePtrOutputWithContext(context.Background())
}
func (o EnterpriseDatabaseOutput) ToEnterpriseDatabasePtrOutputWithContext(ctx context.Context) EnterpriseDatabasePtrOutput {
return o.ApplyT(func(v EnterpriseDatabase) *EnterpriseDatabase {
return &v
}).(EnterpriseDatabasePtrOutput)
}
type EnterpriseDatabasePtrOutput struct {
*pulumi.OutputState
}
func (EnterpriseDatabasePtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**EnterpriseDatabase)(nil))
}
func (o EnterpriseDatabasePtrOutput) ToEnterpriseDatabasePtrOutput() EnterpriseDatabasePtrOutput {
return o
}
func (o EnterpriseDatabasePtrOutput) ToEnterpriseDatabasePtrOutputWithContext(ctx context.Context) EnterpriseDatabasePtrOutput {
return o
}
type EnterpriseDatabaseArrayOutput struct{ *pulumi.OutputState }
func (EnterpriseDatabaseArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]EnterpriseDatabase)(nil))
}
func (o EnterpriseDatabaseArrayOutput) ToEnterpriseDatabaseArrayOutput() EnterpriseDatabaseArrayOutput {
return o
}
func (o EnterpriseDatabaseArrayOutput) ToEnterpriseDatabaseArrayOutputWithContext(ctx context.Context) EnterpriseDatabaseArrayOutput {
return o
}
func (o EnterpriseDatabaseArrayOutput) Index(i pulumi.IntInput) EnterpriseDatabaseOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) EnterpriseDatabase {
return vs[0].([]EnterpriseDatabase)[vs[1].(int)]
}).(EnterpriseDatabaseOutput)
}
type EnterpriseDatabaseMapOutput struct{ *pulumi.OutputState }
func (EnterpriseDatabaseMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]EnterpriseDatabase)(nil))
}
func (o EnterpriseDatabaseMapOutput) ToEnterpriseDatabaseMapOutput() EnterpriseDatabaseMapOutput {
return o
}
func (o EnterpriseDatabaseMapOutput) ToEnterpriseDatabaseMapOutputWithContext(ctx context.Context) EnterpriseDatabaseMapOutput {
return o
}
func (o EnterpriseDatabaseMapOutput) MapIndex(k pulumi.StringInput) EnterpriseDatabaseOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) EnterpriseDatabase {
return vs[0].(map[string]EnterpriseDatabase)[vs[1].(string)]
}).(EnterpriseDatabaseOutput)
}
func init() {
pulumi.RegisterOutputType(EnterpriseDatabaseOutput{})
pulumi.RegisterOutputType(EnterpriseDatabasePtrOutput{})
pulumi.RegisterOutputType(EnterpriseDatabaseArrayOutput{})
pulumi.RegisterOutputType(EnterpriseDatabaseMapOutput{})
}