/
backendAddressPool.go
332 lines (286 loc) · 14.2 KB
/
backendAddressPool.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
// *** 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 lb
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Load Balancer Backend Address Pool.
//
// > **NOTE:** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v4/go/azure/lb"
// "github.com/pulumi/pulumi-azure/sdk/v4/go/azure/network"
// "github.com/pulumi/pulumi/sdk/v3/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
// }
// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{
// Location: exampleResourceGroup.Location,
// ResourceGroupName: exampleResourceGroup.Name,
// AllocationMethod: pulumi.String("Static"),
// })
// if err != nil {
// return err
// }
// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{
// Location: exampleResourceGroup.Location,
// ResourceGroupName: exampleResourceGroup.Name,
// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{
// &lb.LoadBalancerFrontendIpConfigurationArgs{
// Name: pulumi.String("PublicIPAddress"),
// PublicIpAddressId: examplePublicIp.ID(),
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = lb.NewBackendAddressPool(ctx, "exampleBackendAddressPool", &lb.BackendAddressPoolArgs{
// LoadbalancerId: exampleLoadBalancer.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Load Balancer Backend Address Pools can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:lb/backendAddressPool:BackendAddressPool example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/pool1
// ```
type BackendAddressPool struct {
pulumi.CustomResourceState
// Deprecated: This field is non-functional and will be removed in version 3.0 of the Azure Provider - use the separate `azurerm_lb_backend_address_pool_address` resource instead.
BackendAddresses BackendAddressPoolBackendAddressArrayOutput `pulumi:"backendAddresses"`
// The Backend IP Configurations associated with this Backend Address Pool.
BackendIpConfigurations pulumi.StringArrayOutput `pulumi:"backendIpConfigurations"`
// The Load Balancing Rules associated with this Backend Address Pool.
LoadBalancingRules pulumi.StringArrayOutput `pulumi:"loadBalancingRules"`
// The ID of the Load Balancer in which to create the Backend Address Pool.
LoadbalancerId pulumi.StringOutput `pulumi:"loadbalancerId"`
// Specifies the name of the Backend Address Pool.
Name pulumi.StringOutput `pulumi:"name"`
// An array of the Load Balancing Outbound Rules associated with this Backend Address Pool.
OutboundRules pulumi.StringArrayOutput `pulumi:"outboundRules"`
// Deprecated: This field is no longer used and will be removed in the next major version of the Azure Provider
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// One or more `tunnelInterface` blocks as defined below.
TunnelInterfaces BackendAddressPoolTunnelInterfaceArrayOutput `pulumi:"tunnelInterfaces"`
}
// NewBackendAddressPool registers a new resource with the given unique name, arguments, and options.
func NewBackendAddressPool(ctx *pulumi.Context,
name string, args *BackendAddressPoolArgs, opts ...pulumi.ResourceOption) (*BackendAddressPool, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.LoadbalancerId == nil {
return nil, errors.New("invalid value for required argument 'LoadbalancerId'")
}
var resource BackendAddressPool
err := ctx.RegisterResource("azure:lb/backendAddressPool:BackendAddressPool", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBackendAddressPool gets an existing BackendAddressPool 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 GetBackendAddressPool(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BackendAddressPoolState, opts ...pulumi.ResourceOption) (*BackendAddressPool, error) {
var resource BackendAddressPool
err := ctx.ReadResource("azure:lb/backendAddressPool:BackendAddressPool", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering BackendAddressPool resources.
type backendAddressPoolState struct {
// Deprecated: This field is non-functional and will be removed in version 3.0 of the Azure Provider - use the separate `azurerm_lb_backend_address_pool_address` resource instead.
BackendAddresses []BackendAddressPoolBackendAddress `pulumi:"backendAddresses"`
// The Backend IP Configurations associated with this Backend Address Pool.
BackendIpConfigurations []string `pulumi:"backendIpConfigurations"`
// The Load Balancing Rules associated with this Backend Address Pool.
LoadBalancingRules []string `pulumi:"loadBalancingRules"`
// The ID of the Load Balancer in which to create the Backend Address Pool.
LoadbalancerId *string `pulumi:"loadbalancerId"`
// Specifies the name of the Backend Address Pool.
Name *string `pulumi:"name"`
// An array of the Load Balancing Outbound Rules associated with this Backend Address Pool.
OutboundRules []string `pulumi:"outboundRules"`
// Deprecated: This field is no longer used and will be removed in the next major version of the Azure Provider
ResourceGroupName *string `pulumi:"resourceGroupName"`
// One or more `tunnelInterface` blocks as defined below.
TunnelInterfaces []BackendAddressPoolTunnelInterface `pulumi:"tunnelInterfaces"`
}
type BackendAddressPoolState struct {
// Deprecated: This field is non-functional and will be removed in version 3.0 of the Azure Provider - use the separate `azurerm_lb_backend_address_pool_address` resource instead.
BackendAddresses BackendAddressPoolBackendAddressArrayInput
// The Backend IP Configurations associated with this Backend Address Pool.
BackendIpConfigurations pulumi.StringArrayInput
// The Load Balancing Rules associated with this Backend Address Pool.
LoadBalancingRules pulumi.StringArrayInput
// The ID of the Load Balancer in which to create the Backend Address Pool.
LoadbalancerId pulumi.StringPtrInput
// Specifies the name of the Backend Address Pool.
Name pulumi.StringPtrInput
// An array of the Load Balancing Outbound Rules associated with this Backend Address Pool.
OutboundRules pulumi.StringArrayInput
// Deprecated: This field is no longer used and will be removed in the next major version of the Azure Provider
ResourceGroupName pulumi.StringPtrInput
// One or more `tunnelInterface` blocks as defined below.
TunnelInterfaces BackendAddressPoolTunnelInterfaceArrayInput
}
func (BackendAddressPoolState) ElementType() reflect.Type {
return reflect.TypeOf((*backendAddressPoolState)(nil)).Elem()
}
type backendAddressPoolArgs struct {
// Deprecated: This field is non-functional and will be removed in version 3.0 of the Azure Provider - use the separate `azurerm_lb_backend_address_pool_address` resource instead.
BackendAddresses []BackendAddressPoolBackendAddress `pulumi:"backendAddresses"`
// The ID of the Load Balancer in which to create the Backend Address Pool.
LoadbalancerId string `pulumi:"loadbalancerId"`
// Specifies the name of the Backend Address Pool.
Name *string `pulumi:"name"`
// Deprecated: This field is no longer used and will be removed in the next major version of the Azure Provider
ResourceGroupName *string `pulumi:"resourceGroupName"`
// One or more `tunnelInterface` blocks as defined below.
TunnelInterfaces []BackendAddressPoolTunnelInterface `pulumi:"tunnelInterfaces"`
}
// The set of arguments for constructing a BackendAddressPool resource.
type BackendAddressPoolArgs struct {
// Deprecated: This field is non-functional and will be removed in version 3.0 of the Azure Provider - use the separate `azurerm_lb_backend_address_pool_address` resource instead.
BackendAddresses BackendAddressPoolBackendAddressArrayInput
// The ID of the Load Balancer in which to create the Backend Address Pool.
LoadbalancerId pulumi.StringInput
// Specifies the name of the Backend Address Pool.
Name pulumi.StringPtrInput
// Deprecated: This field is no longer used and will be removed in the next major version of the Azure Provider
ResourceGroupName pulumi.StringPtrInput
// One or more `tunnelInterface` blocks as defined below.
TunnelInterfaces BackendAddressPoolTunnelInterfaceArrayInput
}
func (BackendAddressPoolArgs) ElementType() reflect.Type {
return reflect.TypeOf((*backendAddressPoolArgs)(nil)).Elem()
}
type BackendAddressPoolInput interface {
pulumi.Input
ToBackendAddressPoolOutput() BackendAddressPoolOutput
ToBackendAddressPoolOutputWithContext(ctx context.Context) BackendAddressPoolOutput
}
func (*BackendAddressPool) ElementType() reflect.Type {
return reflect.TypeOf((**BackendAddressPool)(nil)).Elem()
}
func (i *BackendAddressPool) ToBackendAddressPoolOutput() BackendAddressPoolOutput {
return i.ToBackendAddressPoolOutputWithContext(context.Background())
}
func (i *BackendAddressPool) ToBackendAddressPoolOutputWithContext(ctx context.Context) BackendAddressPoolOutput {
return pulumi.ToOutputWithContext(ctx, i).(BackendAddressPoolOutput)
}
// BackendAddressPoolArrayInput is an input type that accepts BackendAddressPoolArray and BackendAddressPoolArrayOutput values.
// You can construct a concrete instance of `BackendAddressPoolArrayInput` via:
//
// BackendAddressPoolArray{ BackendAddressPoolArgs{...} }
type BackendAddressPoolArrayInput interface {
pulumi.Input
ToBackendAddressPoolArrayOutput() BackendAddressPoolArrayOutput
ToBackendAddressPoolArrayOutputWithContext(context.Context) BackendAddressPoolArrayOutput
}
type BackendAddressPoolArray []BackendAddressPoolInput
func (BackendAddressPoolArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BackendAddressPool)(nil)).Elem()
}
func (i BackendAddressPoolArray) ToBackendAddressPoolArrayOutput() BackendAddressPoolArrayOutput {
return i.ToBackendAddressPoolArrayOutputWithContext(context.Background())
}
func (i BackendAddressPoolArray) ToBackendAddressPoolArrayOutputWithContext(ctx context.Context) BackendAddressPoolArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BackendAddressPoolArrayOutput)
}
// BackendAddressPoolMapInput is an input type that accepts BackendAddressPoolMap and BackendAddressPoolMapOutput values.
// You can construct a concrete instance of `BackendAddressPoolMapInput` via:
//
// BackendAddressPoolMap{ "key": BackendAddressPoolArgs{...} }
type BackendAddressPoolMapInput interface {
pulumi.Input
ToBackendAddressPoolMapOutput() BackendAddressPoolMapOutput
ToBackendAddressPoolMapOutputWithContext(context.Context) BackendAddressPoolMapOutput
}
type BackendAddressPoolMap map[string]BackendAddressPoolInput
func (BackendAddressPoolMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BackendAddressPool)(nil)).Elem()
}
func (i BackendAddressPoolMap) ToBackendAddressPoolMapOutput() BackendAddressPoolMapOutput {
return i.ToBackendAddressPoolMapOutputWithContext(context.Background())
}
func (i BackendAddressPoolMap) ToBackendAddressPoolMapOutputWithContext(ctx context.Context) BackendAddressPoolMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BackendAddressPoolMapOutput)
}
type BackendAddressPoolOutput struct{ *pulumi.OutputState }
func (BackendAddressPoolOutput) ElementType() reflect.Type {
return reflect.TypeOf((**BackendAddressPool)(nil)).Elem()
}
func (o BackendAddressPoolOutput) ToBackendAddressPoolOutput() BackendAddressPoolOutput {
return o
}
func (o BackendAddressPoolOutput) ToBackendAddressPoolOutputWithContext(ctx context.Context) BackendAddressPoolOutput {
return o
}
type BackendAddressPoolArrayOutput struct{ *pulumi.OutputState }
func (BackendAddressPoolArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BackendAddressPool)(nil)).Elem()
}
func (o BackendAddressPoolArrayOutput) ToBackendAddressPoolArrayOutput() BackendAddressPoolArrayOutput {
return o
}
func (o BackendAddressPoolArrayOutput) ToBackendAddressPoolArrayOutputWithContext(ctx context.Context) BackendAddressPoolArrayOutput {
return o
}
func (o BackendAddressPoolArrayOutput) Index(i pulumi.IntInput) BackendAddressPoolOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BackendAddressPool {
return vs[0].([]*BackendAddressPool)[vs[1].(int)]
}).(BackendAddressPoolOutput)
}
type BackendAddressPoolMapOutput struct{ *pulumi.OutputState }
func (BackendAddressPoolMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BackendAddressPool)(nil)).Elem()
}
func (o BackendAddressPoolMapOutput) ToBackendAddressPoolMapOutput() BackendAddressPoolMapOutput {
return o
}
func (o BackendAddressPoolMapOutput) ToBackendAddressPoolMapOutputWithContext(ctx context.Context) BackendAddressPoolMapOutput {
return o
}
func (o BackendAddressPoolMapOutput) MapIndex(k pulumi.StringInput) BackendAddressPoolOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *BackendAddressPool {
return vs[0].(map[string]*BackendAddressPool)[vs[1].(string)]
}).(BackendAddressPoolOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*BackendAddressPoolInput)(nil)).Elem(), &BackendAddressPool{})
pulumi.RegisterInputType(reflect.TypeOf((*BackendAddressPoolArrayInput)(nil)).Elem(), BackendAddressPoolArray{})
pulumi.RegisterInputType(reflect.TypeOf((*BackendAddressPoolMapInput)(nil)).Elem(), BackendAddressPoolMap{})
pulumi.RegisterOutputType(BackendAddressPoolOutput{})
pulumi.RegisterOutputType(BackendAddressPoolArrayOutput{})
pulumi.RegisterOutputType(BackendAddressPoolMapOutput{})
}