/
getRedis.go
300 lines (258 loc) · 18.3 KB
/
getRedis.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
// 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 aiven
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The Redis data source provides information about the existing Aiven Redis service.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aiven/sdk/v5/go/aiven"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := aiven.LookupRedis(ctx, &GetRedisArgs{
// Project: data.Aiven_project.Pr1.Project,
// ServiceName: "my-redis1",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupRedis(ctx *pulumi.Context, args *LookupRedisArgs, opts ...pulumi.InvokeOption) (*LookupRedisResult, error) {
var rv LookupRedisResult
err := ctx.Invoke("aiven:index/getRedis:getRedis", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getRedis.
type LookupRedisArgs struct {
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
Project string `pulumi:"project"`
// Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the service so name should be picked based on intended service usage rather than current attributes.
ServiceName string `pulumi:"serviceName"`
}
// A collection of values returned by getRedis.
type LookupRedisResult struct {
// Additional disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing will result in the service rebalancing.
AdditionalDiskSpace string `pulumi:"additionalDiskSpace"`
// Defines where the cloud provider and region where the service is hosted in. This can be changed freely after service is created. Changing the value will trigger a potentially lengthy migration process for the service. Format is cloud provider name (`aws`, `azure`, `do` `google`, `upcloud`, etc.), dash, and the cloud provider specific region name. These are documented on each Cloud provider's own support articles, like [here for Google](https://cloud.google.com/compute/docs/regions-zones/) and [here for AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html).
CloudName string `pulumi:"cloudName"`
// Service component information objects
Components []GetRedisComponent `pulumi:"components"`
// Service disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing will result in the service rebalancing.
DiskSpace string `pulumi:"diskSpace"`
// The maximum disk space of the service, possible values depend on the service type, the cloud provider and the project.
DiskSpaceCap string `pulumi:"diskSpaceCap"`
// The default disk space of the service, possible values depend on the service type, the cloud provider and the project. Its also the minimum value for `diskSpace`
DiskSpaceDefault string `pulumi:"diskSpaceDefault"`
// The default disk space step of the service, possible values depend on the service type, the cloud provider and the project. `diskSpace` needs to increment from `diskSpaceDefault` by increments of this size.
DiskSpaceStep string `pulumi:"diskSpaceStep"`
// Disk space that service is currently using
DiskSpaceUsed string `pulumi:"diskSpaceUsed"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc.
MaintenanceWindowDow string `pulumi:"maintenanceWindowDow"`
// Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format.
MaintenanceWindowTime string `pulumi:"maintenanceWindowTime"`
// Defines what kind of computing resources are allocated for the service. It can be changed after creation, though there are some restrictions when going to a smaller plan such as the new plan must have sufficient amount of disk space to store all current data and switching to a plan with fewer nodes might not be supported. The basic plan names are `hobbyist`, `startup-x`, `business-x` and `premium-x` where `x` is (roughly) the amount of memory on each node (also other attributes like number of CPUs and amount of disk space varies but naming is based on memory). The available options can be seem from the [Aiven pricing page](https://aiven.io/pricing).
Plan string `pulumi:"plan"`
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
Project string `pulumi:"project"`
// Specifies the VPC the service should run in. If the value is not set the service is not run inside a VPC. When set, the value should be given as a reference to set up dependencies correctly and the VPC must be in the same cloud and region as the service itself. Project can be freely moved to and from VPC after creation but doing so triggers migration to new servers so the operation can take significant amount of time to complete if the service has a lot of data.
ProjectVpcId string `pulumi:"projectVpcId"`
// Redis server provided values
Redis []GetRedisRedi `pulumi:"redis"`
// Redis user configurable settings
RedisUserConfigs []GetRedisRedisUserConfig `pulumi:"redisUserConfigs"`
// The hostname of the service.
ServiceHost string `pulumi:"serviceHost"`
// Service integrations to specify when creating a service. Not applied after initial service creation
ServiceIntegrations []GetRedisServiceIntegration `pulumi:"serviceIntegrations"`
// Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the service so name should be picked based on intended service usage rather than current attributes.
ServiceName string `pulumi:"serviceName"`
// Password used for connecting to the service, if applicable
ServicePassword string `pulumi:"servicePassword"`
// The port of the service
ServicePort int `pulumi:"servicePort"`
// Aiven internal service type code
ServiceType string `pulumi:"serviceType"`
// URI for connecting to the service. Service specific info is under "kafka", "pg", etc.
ServiceUri string `pulumi:"serviceUri"`
// Username used for connecting to the service, if applicable
ServiceUsername string `pulumi:"serviceUsername"`
// Service state. One of `POWEROFF`, `REBALANCING`, `REBUILDING` or `RUNNING`
State string `pulumi:"state"`
// Static IPs that are going to be associated with this service. Please assign a value using the 'toset' function. Once a static ip resource is in the 'assigned' state it cannot be unbound from the node again
StaticIps []string `pulumi:"staticIps"`
// Tags are key-value pairs that allow you to categorize services.
Tags []GetRedisTag `pulumi:"tags"`
// Prevents the service from being deleted. It is recommended to set this to `true` for all production services to prevent unintentional service deletion. This does not shield against deleting databases or topics but for services with backups much of the content can at least be restored from backup in case accidental deletion is done.
TerminationProtection bool `pulumi:"terminationProtection"`
}
func LookupRedisOutput(ctx *pulumi.Context, args LookupRedisOutputArgs, opts ...pulumi.InvokeOption) LookupRedisResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupRedisResult, error) {
args := v.(LookupRedisArgs)
r, err := LookupRedis(ctx, &args, opts...)
var s LookupRedisResult
if r != nil {
s = *r
}
return s, err
}).(LookupRedisResultOutput)
}
// A collection of arguments for invoking getRedis.
type LookupRedisOutputArgs struct {
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
Project pulumi.StringInput `pulumi:"project"`
// Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the service so name should be picked based on intended service usage rather than current attributes.
ServiceName pulumi.StringInput `pulumi:"serviceName"`
}
func (LookupRedisOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupRedisArgs)(nil)).Elem()
}
// A collection of values returned by getRedis.
type LookupRedisResultOutput struct{ *pulumi.OutputState }
func (LookupRedisResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupRedisResult)(nil)).Elem()
}
func (o LookupRedisResultOutput) ToLookupRedisResultOutput() LookupRedisResultOutput {
return o
}
func (o LookupRedisResultOutput) ToLookupRedisResultOutputWithContext(ctx context.Context) LookupRedisResultOutput {
return o
}
// Additional disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing will result in the service rebalancing.
func (o LookupRedisResultOutput) AdditionalDiskSpace() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.AdditionalDiskSpace }).(pulumi.StringOutput)
}
// Defines where the cloud provider and region where the service is hosted in. This can be changed freely after service is created. Changing the value will trigger a potentially lengthy migration process for the service. Format is cloud provider name (`aws`, `azure`, `do` `google`, `upcloud`, etc.), dash, and the cloud provider specific region name. These are documented on each Cloud provider's own support articles, like [here for Google](https://cloud.google.com/compute/docs/regions-zones/) and [here for AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html).
func (o LookupRedisResultOutput) CloudName() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.CloudName }).(pulumi.StringOutput)
}
// Service component information objects
func (o LookupRedisResultOutput) Components() GetRedisComponentArrayOutput {
return o.ApplyT(func(v LookupRedisResult) []GetRedisComponent { return v.Components }).(GetRedisComponentArrayOutput)
}
// Service disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing will result in the service rebalancing.
func (o LookupRedisResultOutput) DiskSpace() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.DiskSpace }).(pulumi.StringOutput)
}
// The maximum disk space of the service, possible values depend on the service type, the cloud provider and the project.
func (o LookupRedisResultOutput) DiskSpaceCap() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.DiskSpaceCap }).(pulumi.StringOutput)
}
// The default disk space of the service, possible values depend on the service type, the cloud provider and the project. Its also the minimum value for `diskSpace`
func (o LookupRedisResultOutput) DiskSpaceDefault() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.DiskSpaceDefault }).(pulumi.StringOutput)
}
// The default disk space step of the service, possible values depend on the service type, the cloud provider and the project. `diskSpace` needs to increment from `diskSpaceDefault` by increments of this size.
func (o LookupRedisResultOutput) DiskSpaceStep() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.DiskSpaceStep }).(pulumi.StringOutput)
}
// Disk space that service is currently using
func (o LookupRedisResultOutput) DiskSpaceUsed() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.DiskSpaceUsed }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupRedisResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.Id }).(pulumi.StringOutput)
}
// Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc.
func (o LookupRedisResultOutput) MaintenanceWindowDow() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.MaintenanceWindowDow }).(pulumi.StringOutput)
}
// Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format.
func (o LookupRedisResultOutput) MaintenanceWindowTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.MaintenanceWindowTime }).(pulumi.StringOutput)
}
// Defines what kind of computing resources are allocated for the service. It can be changed after creation, though there are some restrictions when going to a smaller plan such as the new plan must have sufficient amount of disk space to store all current data and switching to a plan with fewer nodes might not be supported. The basic plan names are `hobbyist`, `startup-x`, `business-x` and `premium-x` where `x` is (roughly) the amount of memory on each node (also other attributes like number of CPUs and amount of disk space varies but naming is based on memory). The available options can be seem from the [Aiven pricing page](https://aiven.io/pricing).
func (o LookupRedisResultOutput) Plan() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.Plan }).(pulumi.StringOutput)
}
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
func (o LookupRedisResultOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.Project }).(pulumi.StringOutput)
}
// Specifies the VPC the service should run in. If the value is not set the service is not run inside a VPC. When set, the value should be given as a reference to set up dependencies correctly and the VPC must be in the same cloud and region as the service itself. Project can be freely moved to and from VPC after creation but doing so triggers migration to new servers so the operation can take significant amount of time to complete if the service has a lot of data.
func (o LookupRedisResultOutput) ProjectVpcId() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.ProjectVpcId }).(pulumi.StringOutput)
}
// Redis server provided values
func (o LookupRedisResultOutput) Redis() GetRedisRediArrayOutput {
return o.ApplyT(func(v LookupRedisResult) []GetRedisRedi { return v.Redis }).(GetRedisRediArrayOutput)
}
// Redis user configurable settings
func (o LookupRedisResultOutput) RedisUserConfigs() GetRedisRedisUserConfigArrayOutput {
return o.ApplyT(func(v LookupRedisResult) []GetRedisRedisUserConfig { return v.RedisUserConfigs }).(GetRedisRedisUserConfigArrayOutput)
}
// The hostname of the service.
func (o LookupRedisResultOutput) ServiceHost() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.ServiceHost }).(pulumi.StringOutput)
}
// Service integrations to specify when creating a service. Not applied after initial service creation
func (o LookupRedisResultOutput) ServiceIntegrations() GetRedisServiceIntegrationArrayOutput {
return o.ApplyT(func(v LookupRedisResult) []GetRedisServiceIntegration { return v.ServiceIntegrations }).(GetRedisServiceIntegrationArrayOutput)
}
// Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the service so name should be picked based on intended service usage rather than current attributes.
func (o LookupRedisResultOutput) ServiceName() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.ServiceName }).(pulumi.StringOutput)
}
// Password used for connecting to the service, if applicable
func (o LookupRedisResultOutput) ServicePassword() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.ServicePassword }).(pulumi.StringOutput)
}
// The port of the service
func (o LookupRedisResultOutput) ServicePort() pulumi.IntOutput {
return o.ApplyT(func(v LookupRedisResult) int { return v.ServicePort }).(pulumi.IntOutput)
}
// Aiven internal service type code
func (o LookupRedisResultOutput) ServiceType() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.ServiceType }).(pulumi.StringOutput)
}
// URI for connecting to the service. Service specific info is under "kafka", "pg", etc.
func (o LookupRedisResultOutput) ServiceUri() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.ServiceUri }).(pulumi.StringOutput)
}
// Username used for connecting to the service, if applicable
func (o LookupRedisResultOutput) ServiceUsername() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.ServiceUsername }).(pulumi.StringOutput)
}
// Service state. One of `POWEROFF`, `REBALANCING`, `REBUILDING` or `RUNNING`
func (o LookupRedisResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupRedisResult) string { return v.State }).(pulumi.StringOutput)
}
// Static IPs that are going to be associated with this service. Please assign a value using the 'toset' function. Once a static ip resource is in the 'assigned' state it cannot be unbound from the node again
func (o LookupRedisResultOutput) StaticIps() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupRedisResult) []string { return v.StaticIps }).(pulumi.StringArrayOutput)
}
// Tags are key-value pairs that allow you to categorize services.
func (o LookupRedisResultOutput) Tags() GetRedisTagArrayOutput {
return o.ApplyT(func(v LookupRedisResult) []GetRedisTag { return v.Tags }).(GetRedisTagArrayOutput)
}
// Prevents the service from being deleted. It is recommended to set this to `true` for all production services to prevent unintentional service deletion. This does not shield against deleting databases or topics but for services with backups much of the content can at least be restored from backup in case accidental deletion is done.
func (o LookupRedisResultOutput) TerminationProtection() pulumi.BoolOutput {
return o.ApplyT(func(v LookupRedisResult) bool { return v.TerminationProtection }).(pulumi.BoolOutput)
}
func init() {
pulumi.RegisterOutputType(LookupRedisResultOutput{})
}