/
getCache.go
246 lines (209 loc) · 9.55 KB
/
getCache.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
// *** 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/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Redis Cache
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v4/go/azure/redis"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := redis.LookupCache(ctx, &redis.LookupCacheArgs{
// Name: "myrediscache",
// ResourceGroupName: "redis-cache",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("primaryAccessKey", example.PrimaryAccessKey)
// ctx.Export("hostname", example.Hostname)
// return nil
// })
// }
// ```
func LookupCache(ctx *pulumi.Context, args *LookupCacheArgs, opts ...pulumi.InvokeOption) (*LookupCacheResult, error) {
var rv LookupCacheResult
err := ctx.Invoke("azure:redis/getCache:getCache", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getCache.
type LookupCacheArgs struct {
// The name of the Redis cache
Name string `pulumi:"name"`
// The name of the resource group the Redis cache instance is located in.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getCache.
type LookupCacheResult struct {
// The size of the Redis Cache deployed.
Capacity int `pulumi:"capacity"`
// Whether the SSL port is enabled.
EnableNonSslPort bool `pulumi:"enableNonSslPort"`
// The SKU family/pricing group used. Possible 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"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The location of the Redis Cache.
Location string `pulumi:"location"`
// The minimum TLS version.
MinimumTlsVersion string `pulumi:"minimumTlsVersion"`
Name string `pulumi:"name"`
// A list of `patchSchedule` blocks as defined below.
PatchSchedules []GetCachePatchSchedule `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"`
PrivateStaticIpAddress string `pulumi:"privateStaticIpAddress"`
// A `redisConfiguration` block as defined below.
RedisConfigurations []GetCacheRedisConfiguration `pulumi:"redisConfigurations"`
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"`
ShardCount int `pulumi:"shardCount"`
// The SKU of Redis used. Possible values are `Basic`, `Standard` and `Premium`.
SkuName string `pulumi:"skuName"`
// The SSL Port of the Redis Instance
SslPort int `pulumi:"sslPort"`
SubnetId string `pulumi:"subnetId"`
Tags map[string]string `pulumi:"tags"`
Zones []string `pulumi:"zones"`
}
func LookupCacheOutput(ctx *pulumi.Context, args LookupCacheOutputArgs, opts ...pulumi.InvokeOption) LookupCacheResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupCacheResult, error) {
args := v.(LookupCacheArgs)
r, err := LookupCache(ctx, &args, opts...)
return *r, err
}).(LookupCacheResultOutput)
}
// A collection of arguments for invoking getCache.
type LookupCacheOutputArgs struct {
// The name of the Redis cache
Name pulumi.StringInput `pulumi:"name"`
// The name of the resource group the Redis cache instance is located in.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupCacheOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCacheArgs)(nil)).Elem()
}
// A collection of values returned by getCache.
type LookupCacheResultOutput struct{ *pulumi.OutputState }
func (LookupCacheResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCacheResult)(nil)).Elem()
}
func (o LookupCacheResultOutput) ToLookupCacheResultOutput() LookupCacheResultOutput {
return o
}
func (o LookupCacheResultOutput) ToLookupCacheResultOutputWithContext(ctx context.Context) LookupCacheResultOutput {
return o
}
// The size of the Redis Cache deployed.
func (o LookupCacheResultOutput) Capacity() pulumi.IntOutput {
return o.ApplyT(func(v LookupCacheResult) int { return v.Capacity }).(pulumi.IntOutput)
}
// Whether the SSL port is enabled.
func (o LookupCacheResultOutput) EnableNonSslPort() pulumi.BoolOutput {
return o.ApplyT(func(v LookupCacheResult) bool { return v.EnableNonSslPort }).(pulumi.BoolOutput)
}
// The SKU family/pricing group used. Possible values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`)
func (o LookupCacheResultOutput) Family() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.Family }).(pulumi.StringOutput)
}
// The Hostname of the Redis Instance
func (o LookupCacheResultOutput) Hostname() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.Hostname }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupCacheResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.Id }).(pulumi.StringOutput)
}
// The location of the Redis Cache.
func (o LookupCacheResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.Location }).(pulumi.StringOutput)
}
// The minimum TLS version.
func (o LookupCacheResultOutput) MinimumTlsVersion() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.MinimumTlsVersion }).(pulumi.StringOutput)
}
func (o LookupCacheResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.Name }).(pulumi.StringOutput)
}
// A list of `patchSchedule` blocks as defined below.
func (o LookupCacheResultOutput) PatchSchedules() GetCachePatchScheduleArrayOutput {
return o.ApplyT(func(v LookupCacheResult) []GetCachePatchSchedule { return v.PatchSchedules }).(GetCachePatchScheduleArrayOutput)
}
// The non-SSL Port of the Redis Instance
func (o LookupCacheResultOutput) Port() pulumi.IntOutput {
return o.ApplyT(func(v LookupCacheResult) int { return v.Port }).(pulumi.IntOutput)
}
// The Primary Access Key for the Redis Instance
func (o LookupCacheResultOutput) PrimaryAccessKey() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.PrimaryAccessKey }).(pulumi.StringOutput)
}
// The primary connection string of the Redis Instance.
func (o LookupCacheResultOutput) PrimaryConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.PrimaryConnectionString }).(pulumi.StringOutput)
}
func (o LookupCacheResultOutput) PrivateStaticIpAddress() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.PrivateStaticIpAddress }).(pulumi.StringOutput)
}
// A `redisConfiguration` block as defined below.
func (o LookupCacheResultOutput) RedisConfigurations() GetCacheRedisConfigurationArrayOutput {
return o.ApplyT(func(v LookupCacheResult) []GetCacheRedisConfiguration { return v.RedisConfigurations }).(GetCacheRedisConfigurationArrayOutput)
}
func (o LookupCacheResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The Secondary Access Key for the Redis Instance
func (o LookupCacheResultOutput) SecondaryAccessKey() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.SecondaryAccessKey }).(pulumi.StringOutput)
}
// The secondary connection string of the Redis Instance.
func (o LookupCacheResultOutput) SecondaryConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.SecondaryConnectionString }).(pulumi.StringOutput)
}
func (o LookupCacheResultOutput) ShardCount() pulumi.IntOutput {
return o.ApplyT(func(v LookupCacheResult) int { return v.ShardCount }).(pulumi.IntOutput)
}
// The SKU of Redis used. Possible values are `Basic`, `Standard` and `Premium`.
func (o LookupCacheResultOutput) SkuName() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.SkuName }).(pulumi.StringOutput)
}
// The SSL Port of the Redis Instance
func (o LookupCacheResultOutput) SslPort() pulumi.IntOutput {
return o.ApplyT(func(v LookupCacheResult) int { return v.SslPort }).(pulumi.IntOutput)
}
func (o LookupCacheResultOutput) SubnetId() pulumi.StringOutput {
return o.ApplyT(func(v LookupCacheResult) string { return v.SubnetId }).(pulumi.StringOutput)
}
func (o LookupCacheResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupCacheResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func (o LookupCacheResultOutput) Zones() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupCacheResult) []string { return v.Zones }).(pulumi.StringArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupCacheResultOutput{})
}