generated from pulumi/pulumi-tf-provider-boilerplate
/
albBackendGroup.go
384 lines (329 loc) · 15.7 KB
/
albBackendGroup.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
// 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"
)
// Creates a backend group in the specified folder and adds the specified backends to it.
// For more information, see [the official documentation](https://cloud.yandex.com/en/docs/application-load-balancer/concepts/backend-group).
//
// ## 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 {
// _, err := yandex.NewAlbBackendGroup(ctx, "test-backend-group", &yandex.AlbBackendGroupArgs{
// HttpBackends: AlbBackendGroupHttpBackendArray{
// &AlbBackendGroupHttpBackendArgs{
// Healthcheck: &AlbBackendGroupHttpBackendHealthcheckArgs{
// HttpHealthcheck: &AlbBackendGroupHttpBackendHealthcheckHttpHealthcheckArgs{
// Path: pulumi.String("/"),
// },
// Interval: pulumi.String("1s"),
// Timeout: pulumi.String("1s"),
// },
// Http2: pulumi.Bool(true),
// LoadBalancingConfig: &AlbBackendGroupHttpBackendLoadBalancingConfigArgs{
// PanicThreshold: pulumi.Int(50),
// },
// Name: pulumi.String("test-http-backend"),
// Port: pulumi.Int(8080),
// TargetGroupIds: pulumi.StringArray{
// pulumi.Any(yandex_alb_target_group.TestTargetGroup.Id),
// },
// Tls: &AlbBackendGroupHttpBackendTlsArgs{
// Sni: pulumi.String("backend-domain.internal"),
// },
// Weight: pulumi.Int(1),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// A backend group can be imported using the `id` of the resource, e.g.
//
// ```sh
//
// $ pulumi import yandex:index/albBackendGroup:AlbBackendGroup default backend_group_id
//
// ```
type AlbBackendGroup struct {
pulumi.CustomResourceState
// The backend group creation timestamp.
CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
// Description of the backend group.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Folder that the resource belongs to. If value is omitted, the default provider folder is used.
FolderId pulumi.StringOutput `pulumi:"folderId"`
// Grpc backend specification that will be used by the ALB Backend Group. Structure is documented below.
GrpcBackends AlbBackendGroupGrpcBackendArrayOutput `pulumi:"grpcBackends"`
// Http backend specification that will be used by the ALB Backend Group. Structure is documented below.
HttpBackends AlbBackendGroupHttpBackendArrayOutput `pulumi:"httpBackends"`
// Labels to assign to this backend group.
Labels pulumi.StringMapOutput `pulumi:"labels"`
// Name of the backend.
Name pulumi.StringOutput `pulumi:"name"`
SessionAffinity AlbBackendGroupSessionAffinityPtrOutput `pulumi:"sessionAffinity"`
// Stream backend specification that will be used by the ALB Backend Group. Structure is documented below.
StreamBackends AlbBackendGroupStreamBackendArrayOutput `pulumi:"streamBackends"`
}
// NewAlbBackendGroup registers a new resource with the given unique name, arguments, and options.
func NewAlbBackendGroup(ctx *pulumi.Context,
name string, args *AlbBackendGroupArgs, opts ...pulumi.ResourceOption) (*AlbBackendGroup, error) {
if args == nil {
args = &AlbBackendGroupArgs{}
}
opts = pkgResourceDefaultOpts(opts)
var resource AlbBackendGroup
err := ctx.RegisterResource("yandex:index/albBackendGroup:AlbBackendGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAlbBackendGroup gets an existing AlbBackendGroup 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 GetAlbBackendGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AlbBackendGroupState, opts ...pulumi.ResourceOption) (*AlbBackendGroup, error) {
var resource AlbBackendGroup
err := ctx.ReadResource("yandex:index/albBackendGroup:AlbBackendGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AlbBackendGroup resources.
type albBackendGroupState struct {
// The backend group creation timestamp.
CreatedAt *string `pulumi:"createdAt"`
// Description of the backend group.
Description *string `pulumi:"description"`
// Folder that the resource belongs to. If value is omitted, the default provider folder is used.
FolderId *string `pulumi:"folderId"`
// Grpc backend specification that will be used by the ALB Backend Group. Structure is documented below.
GrpcBackends []AlbBackendGroupGrpcBackend `pulumi:"grpcBackends"`
// Http backend specification that will be used by the ALB Backend Group. Structure is documented below.
HttpBackends []AlbBackendGroupHttpBackend `pulumi:"httpBackends"`
// Labels to assign to this backend group.
Labels map[string]string `pulumi:"labels"`
// Name of the backend.
Name *string `pulumi:"name"`
SessionAffinity *AlbBackendGroupSessionAffinity `pulumi:"sessionAffinity"`
// Stream backend specification that will be used by the ALB Backend Group. Structure is documented below.
StreamBackends []AlbBackendGroupStreamBackend `pulumi:"streamBackends"`
}
type AlbBackendGroupState struct {
// The backend group creation timestamp.
CreatedAt pulumi.StringPtrInput
// Description of the backend group.
Description pulumi.StringPtrInput
// Folder that the resource belongs to. If value is omitted, the default provider folder is used.
FolderId pulumi.StringPtrInput
// Grpc backend specification that will be used by the ALB Backend Group. Structure is documented below.
GrpcBackends AlbBackendGroupGrpcBackendArrayInput
// Http backend specification that will be used by the ALB Backend Group. Structure is documented below.
HttpBackends AlbBackendGroupHttpBackendArrayInput
// Labels to assign to this backend group.
Labels pulumi.StringMapInput
// Name of the backend.
Name pulumi.StringPtrInput
SessionAffinity AlbBackendGroupSessionAffinityPtrInput
// Stream backend specification that will be used by the ALB Backend Group. Structure is documented below.
StreamBackends AlbBackendGroupStreamBackendArrayInput
}
func (AlbBackendGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*albBackendGroupState)(nil)).Elem()
}
type albBackendGroupArgs struct {
// Description of the backend group.
Description *string `pulumi:"description"`
// Folder that the resource belongs to. If value is omitted, the default provider folder is used.
FolderId *string `pulumi:"folderId"`
// Grpc backend specification that will be used by the ALB Backend Group. Structure is documented below.
GrpcBackends []AlbBackendGroupGrpcBackend `pulumi:"grpcBackends"`
// Http backend specification that will be used by the ALB Backend Group. Structure is documented below.
HttpBackends []AlbBackendGroupHttpBackend `pulumi:"httpBackends"`
// Labels to assign to this backend group.
Labels map[string]string `pulumi:"labels"`
// Name of the backend.
Name *string `pulumi:"name"`
SessionAffinity *AlbBackendGroupSessionAffinity `pulumi:"sessionAffinity"`
// Stream backend specification that will be used by the ALB Backend Group. Structure is documented below.
StreamBackends []AlbBackendGroupStreamBackend `pulumi:"streamBackends"`
}
// The set of arguments for constructing a AlbBackendGroup resource.
type AlbBackendGroupArgs struct {
// Description of the backend group.
Description pulumi.StringPtrInput
// Folder that the resource belongs to. If value is omitted, the default provider folder is used.
FolderId pulumi.StringPtrInput
// Grpc backend specification that will be used by the ALB Backend Group. Structure is documented below.
GrpcBackends AlbBackendGroupGrpcBackendArrayInput
// Http backend specification that will be used by the ALB Backend Group. Structure is documented below.
HttpBackends AlbBackendGroupHttpBackendArrayInput
// Labels to assign to this backend group.
Labels pulumi.StringMapInput
// Name of the backend.
Name pulumi.StringPtrInput
SessionAffinity AlbBackendGroupSessionAffinityPtrInput
// Stream backend specification that will be used by the ALB Backend Group. Structure is documented below.
StreamBackends AlbBackendGroupStreamBackendArrayInput
}
func (AlbBackendGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*albBackendGroupArgs)(nil)).Elem()
}
type AlbBackendGroupInput interface {
pulumi.Input
ToAlbBackendGroupOutput() AlbBackendGroupOutput
ToAlbBackendGroupOutputWithContext(ctx context.Context) AlbBackendGroupOutput
}
func (*AlbBackendGroup) ElementType() reflect.Type {
return reflect.TypeOf((**AlbBackendGroup)(nil)).Elem()
}
func (i *AlbBackendGroup) ToAlbBackendGroupOutput() AlbBackendGroupOutput {
return i.ToAlbBackendGroupOutputWithContext(context.Background())
}
func (i *AlbBackendGroup) ToAlbBackendGroupOutputWithContext(ctx context.Context) AlbBackendGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(AlbBackendGroupOutput)
}
// AlbBackendGroupArrayInput is an input type that accepts AlbBackendGroupArray and AlbBackendGroupArrayOutput values.
// You can construct a concrete instance of `AlbBackendGroupArrayInput` via:
//
// AlbBackendGroupArray{ AlbBackendGroupArgs{...} }
type AlbBackendGroupArrayInput interface {
pulumi.Input
ToAlbBackendGroupArrayOutput() AlbBackendGroupArrayOutput
ToAlbBackendGroupArrayOutputWithContext(context.Context) AlbBackendGroupArrayOutput
}
type AlbBackendGroupArray []AlbBackendGroupInput
func (AlbBackendGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AlbBackendGroup)(nil)).Elem()
}
func (i AlbBackendGroupArray) ToAlbBackendGroupArrayOutput() AlbBackendGroupArrayOutput {
return i.ToAlbBackendGroupArrayOutputWithContext(context.Background())
}
func (i AlbBackendGroupArray) ToAlbBackendGroupArrayOutputWithContext(ctx context.Context) AlbBackendGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AlbBackendGroupArrayOutput)
}
// AlbBackendGroupMapInput is an input type that accepts AlbBackendGroupMap and AlbBackendGroupMapOutput values.
// You can construct a concrete instance of `AlbBackendGroupMapInput` via:
//
// AlbBackendGroupMap{ "key": AlbBackendGroupArgs{...} }
type AlbBackendGroupMapInput interface {
pulumi.Input
ToAlbBackendGroupMapOutput() AlbBackendGroupMapOutput
ToAlbBackendGroupMapOutputWithContext(context.Context) AlbBackendGroupMapOutput
}
type AlbBackendGroupMap map[string]AlbBackendGroupInput
func (AlbBackendGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AlbBackendGroup)(nil)).Elem()
}
func (i AlbBackendGroupMap) ToAlbBackendGroupMapOutput() AlbBackendGroupMapOutput {
return i.ToAlbBackendGroupMapOutputWithContext(context.Background())
}
func (i AlbBackendGroupMap) ToAlbBackendGroupMapOutputWithContext(ctx context.Context) AlbBackendGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AlbBackendGroupMapOutput)
}
type AlbBackendGroupOutput struct{ *pulumi.OutputState }
func (AlbBackendGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AlbBackendGroup)(nil)).Elem()
}
func (o AlbBackendGroupOutput) ToAlbBackendGroupOutput() AlbBackendGroupOutput {
return o
}
func (o AlbBackendGroupOutput) ToAlbBackendGroupOutputWithContext(ctx context.Context) AlbBackendGroupOutput {
return o
}
// The backend group creation timestamp.
func (o AlbBackendGroupOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *AlbBackendGroup) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
}
// Description of the backend group.
func (o AlbBackendGroupOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AlbBackendGroup) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Folder that the resource belongs to. If value is omitted, the default provider folder is used.
func (o AlbBackendGroupOutput) FolderId() pulumi.StringOutput {
return o.ApplyT(func(v *AlbBackendGroup) pulumi.StringOutput { return v.FolderId }).(pulumi.StringOutput)
}
// Grpc backend specification that will be used by the ALB Backend Group. Structure is documented below.
func (o AlbBackendGroupOutput) GrpcBackends() AlbBackendGroupGrpcBackendArrayOutput {
return o.ApplyT(func(v *AlbBackendGroup) AlbBackendGroupGrpcBackendArrayOutput { return v.GrpcBackends }).(AlbBackendGroupGrpcBackendArrayOutput)
}
// Http backend specification that will be used by the ALB Backend Group. Structure is documented below.
func (o AlbBackendGroupOutput) HttpBackends() AlbBackendGroupHttpBackendArrayOutput {
return o.ApplyT(func(v *AlbBackendGroup) AlbBackendGroupHttpBackendArrayOutput { return v.HttpBackends }).(AlbBackendGroupHttpBackendArrayOutput)
}
// Labels to assign to this backend group.
func (o AlbBackendGroupOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v *AlbBackendGroup) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
}
// Name of the backend.
func (o AlbBackendGroupOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *AlbBackendGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o AlbBackendGroupOutput) SessionAffinity() AlbBackendGroupSessionAffinityPtrOutput {
return o.ApplyT(func(v *AlbBackendGroup) AlbBackendGroupSessionAffinityPtrOutput { return v.SessionAffinity }).(AlbBackendGroupSessionAffinityPtrOutput)
}
// Stream backend specification that will be used by the ALB Backend Group. Structure is documented below.
func (o AlbBackendGroupOutput) StreamBackends() AlbBackendGroupStreamBackendArrayOutput {
return o.ApplyT(func(v *AlbBackendGroup) AlbBackendGroupStreamBackendArrayOutput { return v.StreamBackends }).(AlbBackendGroupStreamBackendArrayOutput)
}
type AlbBackendGroupArrayOutput struct{ *pulumi.OutputState }
func (AlbBackendGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AlbBackendGroup)(nil)).Elem()
}
func (o AlbBackendGroupArrayOutput) ToAlbBackendGroupArrayOutput() AlbBackendGroupArrayOutput {
return o
}
func (o AlbBackendGroupArrayOutput) ToAlbBackendGroupArrayOutputWithContext(ctx context.Context) AlbBackendGroupArrayOutput {
return o
}
func (o AlbBackendGroupArrayOutput) Index(i pulumi.IntInput) AlbBackendGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AlbBackendGroup {
return vs[0].([]*AlbBackendGroup)[vs[1].(int)]
}).(AlbBackendGroupOutput)
}
type AlbBackendGroupMapOutput struct{ *pulumi.OutputState }
func (AlbBackendGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AlbBackendGroup)(nil)).Elem()
}
func (o AlbBackendGroupMapOutput) ToAlbBackendGroupMapOutput() AlbBackendGroupMapOutput {
return o
}
func (o AlbBackendGroupMapOutput) ToAlbBackendGroupMapOutputWithContext(ctx context.Context) AlbBackendGroupMapOutput {
return o
}
func (o AlbBackendGroupMapOutput) MapIndex(k pulumi.StringInput) AlbBackendGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AlbBackendGroup {
return vs[0].(map[string]*AlbBackendGroup)[vs[1].(string)]
}).(AlbBackendGroupOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AlbBackendGroupInput)(nil)).Elem(), &AlbBackendGroup{})
pulumi.RegisterInputType(reflect.TypeOf((*AlbBackendGroupArrayInput)(nil)).Elem(), AlbBackendGroupArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AlbBackendGroupMapInput)(nil)).Elem(), AlbBackendGroupMap{})
pulumi.RegisterOutputType(AlbBackendGroupOutput{})
pulumi.RegisterOutputType(AlbBackendGroupArrayOutput{})
pulumi.RegisterOutputType(AlbBackendGroupMapOutput{})
}