-
Notifications
You must be signed in to change notification settings - Fork 51
/
cache.go
708 lines (634 loc) · 36.9 KB
/
cache.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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
// 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 redis
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Redis Cache.
//
// > **Note:** Redis version 4 is being retired and no longer supports creating new instances. Version 4 will be removed in a future release. [Redis Version 4 Retirement](https://learn.microsoft.com/azure/azure-cache-for-redis/cache-retired-features#important-upgrade-timelines)
//
// ## Example Usage
//
// This example provisions a Standard Redis Cache.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// // NOTE: the Name used for Redis needs to be globally unique
// _, err = redis.NewCache(ctx, "example", &redis.CacheArgs{
// Name: pulumi.String("example-cache"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// Capacity: pulumi.Int(2),
// Family: pulumi.String("C"),
// SkuName: pulumi.String("Standard"),
// EnableNonSslPort: pulumi.Bool(false),
// MinimumTlsVersion: pulumi.String("1.2"),
// RedisConfiguration: nil,
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Relevant Links
//
// * [Azure Cache for Redis planning](https://docs.microsoft.com/azure/azure-cache-for-redis/cache-planning-faq)
// * [Redis: Available Configuration Settings](https://redis.io/topics/config)
//
// ## Import
//
// Redis Cache's can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:redis/cache:Cache cache1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redis/cache1
// ```
type Cache struct {
pulumi.CustomResourceState
// The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`.
Capacity pulumi.IntOutput `pulumi:"capacity"`
// Enable the non-SSL port (6379) - disabled by default.
EnableNonSslPort pulumi.BoolPtrOutput `pulumi:"enableNonSslPort"`
// The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`)
Family pulumi.StringOutput `pulumi:"family"`
// The Hostname of the Redis Instance
Hostname pulumi.StringOutput `pulumi:"hostname"`
// An `identity` block as defined below.
Identity CacheIdentityPtrOutput `pulumi:"identity"`
// The location of the resource group. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`.
MinimumTlsVersion pulumi.StringPtrOutput `pulumi:"minimumTlsVersion"`
// The name of the Redis instance. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// A list of `patchSchedule` blocks as defined below.
PatchSchedules CachePatchScheduleArrayOutput `pulumi:"patchSchedules"`
// The non-SSL Port of the Redis Instance
Port pulumi.IntOutput `pulumi:"port"`
// The Primary Access Key for the Redis Instance
PrimaryAccessKey pulumi.StringOutput `pulumi:"primaryAccessKey"`
// The primary connection string of the Redis Instance.
PrimaryConnectionString pulumi.StringOutput `pulumi:"primaryConnectionString"`
// The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnetId`. Changing this forces a new resource to be created.
PrivateStaticIpAddress pulumi.StringOutput `pulumi:"privateStaticIpAddress"`
// Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`.
PublicNetworkAccessEnabled pulumi.BoolPtrOutput `pulumi:"publicNetworkAccessEnabled"`
// A `redisConfiguration` block as defined below - with some limitations by SKU - defaults/details are shown below.
RedisConfiguration CacheRedisConfigurationOutput `pulumi:"redisConfiguration"`
// Redis version. Only major version needed. Valid values: `4`, `6`.
RedisVersion pulumi.StringOutput `pulumi:"redisVersion"`
// Amount of replicas to create per master for this Redis Cache.
//
// > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards.
ReplicasPerMaster pulumi.IntOutput `pulumi:"replicasPerMaster"`
// Amount of replicas to create per primary for this Redis Cache. If both `replicasPerPrimary` and `replicasPerMaster` are set, they need to be equal.
ReplicasPerPrimary pulumi.IntOutput `pulumi:"replicasPerPrimary"`
// The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The Secondary Access Key for the Redis Instance
SecondaryAccessKey pulumi.StringOutput `pulumi:"secondaryAccessKey"`
// The secondary connection string of the Redis Instance.
SecondaryConnectionString pulumi.StringOutput `pulumi:"secondaryConnectionString"`
// *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster.
ShardCount pulumi.IntPtrOutput `pulumi:"shardCount"`
// The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`.
//
// > **Note** Downgrading the SKU will force a new resource to be created.
SkuName pulumi.StringOutput `pulumi:"skuName"`
// The SSL Port of the Redis Instance
SslPort pulumi.IntOutput `pulumi:"sslPort"`
// *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.
SubnetId pulumi.StringPtrOutput `pulumi:"subnetId"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A mapping of tenant settings to assign to the resource.
TenantSettings pulumi.StringMapOutput `pulumi:"tenantSettings"`
// Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.
//
// > **Please Note**: Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll).
Zones pulumi.StringArrayOutput `pulumi:"zones"`
}
// NewCache registers a new resource with the given unique name, arguments, and options.
func NewCache(ctx *pulumi.Context,
name string, args *CacheArgs, opts ...pulumi.ResourceOption) (*Cache, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Capacity == nil {
return nil, errors.New("invalid value for required argument 'Capacity'")
}
if args.Family == nil {
return nil, errors.New("invalid value for required argument 'Family'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.SkuName == nil {
return nil, errors.New("invalid value for required argument 'SkuName'")
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"primaryAccessKey",
"primaryConnectionString",
"secondaryAccessKey",
"secondaryConnectionString",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Cache
err := ctx.RegisterResource("azure:redis/cache:Cache", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCache gets an existing Cache 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 GetCache(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CacheState, opts ...pulumi.ResourceOption) (*Cache, error) {
var resource Cache
err := ctx.ReadResource("azure:redis/cache:Cache", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Cache resources.
type cacheState struct {
// The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`.
Capacity *int `pulumi:"capacity"`
// Enable the non-SSL port (6379) - disabled by default.
EnableNonSslPort *bool `pulumi:"enableNonSslPort"`
// The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`)
Family *string `pulumi:"family"`
// The Hostname of the Redis Instance
Hostname *string `pulumi:"hostname"`
// An `identity` block as defined below.
Identity *CacheIdentity `pulumi:"identity"`
// The location of the resource group. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`.
MinimumTlsVersion *string `pulumi:"minimumTlsVersion"`
// The name of the Redis instance. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A list of `patchSchedule` blocks as defined below.
PatchSchedules []CachePatchSchedule `pulumi:"patchSchedules"`
// The non-SSL Port of the Redis Instance
Port *int `pulumi:"port"`
// The Primary Access Key for the Redis Instance
PrimaryAccessKey *string `pulumi:"primaryAccessKey"`
// The primary connection string of the Redis Instance.
PrimaryConnectionString *string `pulumi:"primaryConnectionString"`
// The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnetId`. Changing this forces a new resource to be created.
PrivateStaticIpAddress *string `pulumi:"privateStaticIpAddress"`
// Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`.
PublicNetworkAccessEnabled *bool `pulumi:"publicNetworkAccessEnabled"`
// A `redisConfiguration` block as defined below - with some limitations by SKU - defaults/details are shown below.
RedisConfiguration *CacheRedisConfiguration `pulumi:"redisConfiguration"`
// Redis version. Only major version needed. Valid values: `4`, `6`.
RedisVersion *string `pulumi:"redisVersion"`
// Amount of replicas to create per master for this Redis Cache.
//
// > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards.
ReplicasPerMaster *int `pulumi:"replicasPerMaster"`
// Amount of replicas to create per primary for this Redis Cache. If both `replicasPerPrimary` and `replicasPerMaster` are set, they need to be equal.
ReplicasPerPrimary *int `pulumi:"replicasPerPrimary"`
// The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The Secondary Access Key for the Redis Instance
SecondaryAccessKey *string `pulumi:"secondaryAccessKey"`
// The secondary connection string of the Redis Instance.
SecondaryConnectionString *string `pulumi:"secondaryConnectionString"`
// *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster.
ShardCount *int `pulumi:"shardCount"`
// The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`.
//
// > **Note** Downgrading the SKU will force a new resource to be created.
SkuName *string `pulumi:"skuName"`
// The SSL Port of the Redis Instance
SslPort *int `pulumi:"sslPort"`
// *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.
SubnetId *string `pulumi:"subnetId"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// A mapping of tenant settings to assign to the resource.
TenantSettings map[string]string `pulumi:"tenantSettings"`
// Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.
//
// > **Please Note**: Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll).
Zones []string `pulumi:"zones"`
}
type CacheState struct {
// The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`.
Capacity pulumi.IntPtrInput
// Enable the non-SSL port (6379) - disabled by default.
EnableNonSslPort pulumi.BoolPtrInput
// The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`)
Family pulumi.StringPtrInput
// The Hostname of the Redis Instance
Hostname pulumi.StringPtrInput
// An `identity` block as defined below.
Identity CacheIdentityPtrInput
// The location of the resource group. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`.
MinimumTlsVersion pulumi.StringPtrInput
// The name of the Redis instance. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A list of `patchSchedule` blocks as defined below.
PatchSchedules CachePatchScheduleArrayInput
// The non-SSL Port of the Redis Instance
Port pulumi.IntPtrInput
// The Primary Access Key for the Redis Instance
PrimaryAccessKey pulumi.StringPtrInput
// The primary connection string of the Redis Instance.
PrimaryConnectionString pulumi.StringPtrInput
// The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnetId`. Changing this forces a new resource to be created.
PrivateStaticIpAddress pulumi.StringPtrInput
// Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`.
PublicNetworkAccessEnabled pulumi.BoolPtrInput
// A `redisConfiguration` block as defined below - with some limitations by SKU - defaults/details are shown below.
RedisConfiguration CacheRedisConfigurationPtrInput
// Redis version. Only major version needed. Valid values: `4`, `6`.
RedisVersion pulumi.StringPtrInput
// Amount of replicas to create per master for this Redis Cache.
//
// > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards.
ReplicasPerMaster pulumi.IntPtrInput
// Amount of replicas to create per primary for this Redis Cache. If both `replicasPerPrimary` and `replicasPerMaster` are set, they need to be equal.
ReplicasPerPrimary pulumi.IntPtrInput
// The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The Secondary Access Key for the Redis Instance
SecondaryAccessKey pulumi.StringPtrInput
// The secondary connection string of the Redis Instance.
SecondaryConnectionString pulumi.StringPtrInput
// *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster.
ShardCount pulumi.IntPtrInput
// The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`.
//
// > **Note** Downgrading the SKU will force a new resource to be created.
SkuName pulumi.StringPtrInput
// The SSL Port of the Redis Instance
SslPort pulumi.IntPtrInput
// *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.
SubnetId pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// A mapping of tenant settings to assign to the resource.
TenantSettings pulumi.StringMapInput
// Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.
//
// > **Please Note**: Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll).
Zones pulumi.StringArrayInput
}
func (CacheState) ElementType() reflect.Type {
return reflect.TypeOf((*cacheState)(nil)).Elem()
}
type cacheArgs struct {
// The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`.
Capacity int `pulumi:"capacity"`
// Enable the non-SSL port (6379) - disabled by default.
EnableNonSslPort *bool `pulumi:"enableNonSslPort"`
// The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`)
Family string `pulumi:"family"`
// An `identity` block as defined below.
Identity *CacheIdentity `pulumi:"identity"`
// The location of the resource group. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`.
MinimumTlsVersion *string `pulumi:"minimumTlsVersion"`
// The name of the Redis instance. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A list of `patchSchedule` blocks as defined below.
PatchSchedules []CachePatchSchedule `pulumi:"patchSchedules"`
// The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnetId`. Changing this forces a new resource to be created.
PrivateStaticIpAddress *string `pulumi:"privateStaticIpAddress"`
// Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`.
PublicNetworkAccessEnabled *bool `pulumi:"publicNetworkAccessEnabled"`
// A `redisConfiguration` block as defined below - with some limitations by SKU - defaults/details are shown below.
RedisConfiguration *CacheRedisConfiguration `pulumi:"redisConfiguration"`
// Redis version. Only major version needed. Valid values: `4`, `6`.
RedisVersion *string `pulumi:"redisVersion"`
// Amount of replicas to create per master for this Redis Cache.
//
// > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards.
ReplicasPerMaster *int `pulumi:"replicasPerMaster"`
// Amount of replicas to create per primary for this Redis Cache. If both `replicasPerPrimary` and `replicasPerMaster` are set, they need to be equal.
ReplicasPerPrimary *int `pulumi:"replicasPerPrimary"`
// The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster.
ShardCount *int `pulumi:"shardCount"`
// The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`.
//
// > **Note** Downgrading the SKU will force a new resource to be created.
SkuName string `pulumi:"skuName"`
// *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.
SubnetId *string `pulumi:"subnetId"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// A mapping of tenant settings to assign to the resource.
TenantSettings map[string]string `pulumi:"tenantSettings"`
// Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.
//
// > **Please Note**: Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll).
Zones []string `pulumi:"zones"`
}
// The set of arguments for constructing a Cache resource.
type CacheArgs struct {
// The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`.
Capacity pulumi.IntInput
// Enable the non-SSL port (6379) - disabled by default.
EnableNonSslPort pulumi.BoolPtrInput
// The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`)
Family pulumi.StringInput
// An `identity` block as defined below.
Identity CacheIdentityPtrInput
// The location of the resource group. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`.
MinimumTlsVersion pulumi.StringPtrInput
// The name of the Redis instance. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A list of `patchSchedule` blocks as defined below.
PatchSchedules CachePatchScheduleArrayInput
// The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnetId`. Changing this forces a new resource to be created.
PrivateStaticIpAddress pulumi.StringPtrInput
// Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`.
PublicNetworkAccessEnabled pulumi.BoolPtrInput
// A `redisConfiguration` block as defined below - with some limitations by SKU - defaults/details are shown below.
RedisConfiguration CacheRedisConfigurationPtrInput
// Redis version. Only major version needed. Valid values: `4`, `6`.
RedisVersion pulumi.StringPtrInput
// Amount of replicas to create per master for this Redis Cache.
//
// > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards.
ReplicasPerMaster pulumi.IntPtrInput
// Amount of replicas to create per primary for this Redis Cache. If both `replicasPerPrimary` and `replicasPerMaster` are set, they need to be equal.
ReplicasPerPrimary pulumi.IntPtrInput
// The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster.
ShardCount pulumi.IntPtrInput
// The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`.
//
// > **Note** Downgrading the SKU will force a new resource to be created.
SkuName pulumi.StringInput
// *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.
SubnetId pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// A mapping of tenant settings to assign to the resource.
TenantSettings pulumi.StringMapInput
// Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.
//
// > **Please Note**: Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll).
Zones pulumi.StringArrayInput
}
func (CacheArgs) ElementType() reflect.Type {
return reflect.TypeOf((*cacheArgs)(nil)).Elem()
}
type CacheInput interface {
pulumi.Input
ToCacheOutput() CacheOutput
ToCacheOutputWithContext(ctx context.Context) CacheOutput
}
func (*Cache) ElementType() reflect.Type {
return reflect.TypeOf((**Cache)(nil)).Elem()
}
func (i *Cache) ToCacheOutput() CacheOutput {
return i.ToCacheOutputWithContext(context.Background())
}
func (i *Cache) ToCacheOutputWithContext(ctx context.Context) CacheOutput {
return pulumi.ToOutputWithContext(ctx, i).(CacheOutput)
}
// CacheArrayInput is an input type that accepts CacheArray and CacheArrayOutput values.
// You can construct a concrete instance of `CacheArrayInput` via:
//
// CacheArray{ CacheArgs{...} }
type CacheArrayInput interface {
pulumi.Input
ToCacheArrayOutput() CacheArrayOutput
ToCacheArrayOutputWithContext(context.Context) CacheArrayOutput
}
type CacheArray []CacheInput
func (CacheArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Cache)(nil)).Elem()
}
func (i CacheArray) ToCacheArrayOutput() CacheArrayOutput {
return i.ToCacheArrayOutputWithContext(context.Background())
}
func (i CacheArray) ToCacheArrayOutputWithContext(ctx context.Context) CacheArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CacheArrayOutput)
}
// CacheMapInput is an input type that accepts CacheMap and CacheMapOutput values.
// You can construct a concrete instance of `CacheMapInput` via:
//
// CacheMap{ "key": CacheArgs{...} }
type CacheMapInput interface {
pulumi.Input
ToCacheMapOutput() CacheMapOutput
ToCacheMapOutputWithContext(context.Context) CacheMapOutput
}
type CacheMap map[string]CacheInput
func (CacheMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Cache)(nil)).Elem()
}
func (i CacheMap) ToCacheMapOutput() CacheMapOutput {
return i.ToCacheMapOutputWithContext(context.Background())
}
func (i CacheMap) ToCacheMapOutputWithContext(ctx context.Context) CacheMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CacheMapOutput)
}
type CacheOutput struct{ *pulumi.OutputState }
func (CacheOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Cache)(nil)).Elem()
}
func (o CacheOutput) ToCacheOutput() CacheOutput {
return o
}
func (o CacheOutput) ToCacheOutputWithContext(ctx context.Context) CacheOutput {
return o
}
// The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`.
func (o CacheOutput) Capacity() pulumi.IntOutput {
return o.ApplyT(func(v *Cache) pulumi.IntOutput { return v.Capacity }).(pulumi.IntOutput)
}
// Enable the non-SSL port (6379) - disabled by default.
func (o CacheOutput) EnableNonSslPort() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Cache) pulumi.BoolPtrOutput { return v.EnableNonSslPort }).(pulumi.BoolPtrOutput)
}
// The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`)
func (o CacheOutput) Family() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.Family }).(pulumi.StringOutput)
}
// The Hostname of the Redis Instance
func (o CacheOutput) Hostname() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.Hostname }).(pulumi.StringOutput)
}
// An `identity` block as defined below.
func (o CacheOutput) Identity() CacheIdentityPtrOutput {
return o.ApplyT(func(v *Cache) CacheIdentityPtrOutput { return v.Identity }).(CacheIdentityPtrOutput)
}
// The location of the resource group. Changing this forces a new resource to be created.
func (o CacheOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`.
func (o CacheOutput) MinimumTlsVersion() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Cache) pulumi.StringPtrOutput { return v.MinimumTlsVersion }).(pulumi.StringPtrOutput)
}
// The name of the Redis instance. Changing this forces a new resource to be created.
func (o CacheOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A list of `patchSchedule` blocks as defined below.
func (o CacheOutput) PatchSchedules() CachePatchScheduleArrayOutput {
return o.ApplyT(func(v *Cache) CachePatchScheduleArrayOutput { return v.PatchSchedules }).(CachePatchScheduleArrayOutput)
}
// The non-SSL Port of the Redis Instance
func (o CacheOutput) Port() pulumi.IntOutput {
return o.ApplyT(func(v *Cache) pulumi.IntOutput { return v.Port }).(pulumi.IntOutput)
}
// The Primary Access Key for the Redis Instance
func (o CacheOutput) PrimaryAccessKey() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.PrimaryAccessKey }).(pulumi.StringOutput)
}
// The primary connection string of the Redis Instance.
func (o CacheOutput) PrimaryConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.PrimaryConnectionString }).(pulumi.StringOutput)
}
// The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnetId`. Changing this forces a new resource to be created.
func (o CacheOutput) PrivateStaticIpAddress() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.PrivateStaticIpAddress }).(pulumi.StringOutput)
}
// Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`.
func (o CacheOutput) PublicNetworkAccessEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Cache) pulumi.BoolPtrOutput { return v.PublicNetworkAccessEnabled }).(pulumi.BoolPtrOutput)
}
// A `redisConfiguration` block as defined below - with some limitations by SKU - defaults/details are shown below.
func (o CacheOutput) RedisConfiguration() CacheRedisConfigurationOutput {
return o.ApplyT(func(v *Cache) CacheRedisConfigurationOutput { return v.RedisConfiguration }).(CacheRedisConfigurationOutput)
}
// Redis version. Only major version needed. Valid values: `4`, `6`.
func (o CacheOutput) RedisVersion() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.RedisVersion }).(pulumi.StringOutput)
}
// Amount of replicas to create per master for this Redis Cache.
//
// > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards.
func (o CacheOutput) ReplicasPerMaster() pulumi.IntOutput {
return o.ApplyT(func(v *Cache) pulumi.IntOutput { return v.ReplicasPerMaster }).(pulumi.IntOutput)
}
// Amount of replicas to create per primary for this Redis Cache. If both `replicasPerPrimary` and `replicasPerMaster` are set, they need to be equal.
func (o CacheOutput) ReplicasPerPrimary() pulumi.IntOutput {
return o.ApplyT(func(v *Cache) pulumi.IntOutput { return v.ReplicasPerPrimary }).(pulumi.IntOutput)
}
// The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created.
func (o CacheOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The Secondary Access Key for the Redis Instance
func (o CacheOutput) SecondaryAccessKey() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.SecondaryAccessKey }).(pulumi.StringOutput)
}
// The secondary connection string of the Redis Instance.
func (o CacheOutput) SecondaryConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.SecondaryConnectionString }).(pulumi.StringOutput)
}
// *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster.
func (o CacheOutput) ShardCount() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Cache) pulumi.IntPtrOutput { return v.ShardCount }).(pulumi.IntPtrOutput)
}
// The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`.
//
// > **Note** Downgrading the SKU will force a new resource to be created.
func (o CacheOutput) SkuName() pulumi.StringOutput {
return o.ApplyT(func(v *Cache) pulumi.StringOutput { return v.SkuName }).(pulumi.StringOutput)
}
// The SSL Port of the Redis Instance
func (o CacheOutput) SslPort() pulumi.IntOutput {
return o.ApplyT(func(v *Cache) pulumi.IntOutput { return v.SslPort }).(pulumi.IntOutput)
}
// *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.
func (o CacheOutput) SubnetId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Cache) pulumi.StringPtrOutput { return v.SubnetId }).(pulumi.StringPtrOutput)
}
// A mapping of tags to assign to the resource.
func (o CacheOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Cache) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// A mapping of tenant settings to assign to the resource.
func (o CacheOutput) TenantSettings() pulumi.StringMapOutput {
return o.ApplyT(func(v *Cache) pulumi.StringMapOutput { return v.TenantSettings }).(pulumi.StringMapOutput)
}
// Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.
//
// > **Please Note**: Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll).
func (o CacheOutput) Zones() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Cache) pulumi.StringArrayOutput { return v.Zones }).(pulumi.StringArrayOutput)
}
type CacheArrayOutput struct{ *pulumi.OutputState }
func (CacheArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Cache)(nil)).Elem()
}
func (o CacheArrayOutput) ToCacheArrayOutput() CacheArrayOutput {
return o
}
func (o CacheArrayOutput) ToCacheArrayOutputWithContext(ctx context.Context) CacheArrayOutput {
return o
}
func (o CacheArrayOutput) Index(i pulumi.IntInput) CacheOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Cache {
return vs[0].([]*Cache)[vs[1].(int)]
}).(CacheOutput)
}
type CacheMapOutput struct{ *pulumi.OutputState }
func (CacheMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Cache)(nil)).Elem()
}
func (o CacheMapOutput) ToCacheMapOutput() CacheMapOutput {
return o
}
func (o CacheMapOutput) ToCacheMapOutputWithContext(ctx context.Context) CacheMapOutput {
return o
}
func (o CacheMapOutput) MapIndex(k pulumi.StringInput) CacheOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Cache {
return vs[0].(map[string]*Cache)[vs[1].(string)]
}).(CacheOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CacheInput)(nil)).Elem(), &Cache{})
pulumi.RegisterInputType(reflect.TypeOf((*CacheArrayInput)(nil)).Elem(), CacheArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CacheMapInput)(nil)).Elem(), CacheMap{})
pulumi.RegisterOutputType(CacheOutput{})
pulumi.RegisterOutputType(CacheArrayOutput{})
pulumi.RegisterOutputType(CacheMapOutput{})
}