-
Notifications
You must be signed in to change notification settings - Fork 154
/
loadBalancer.go
671 lines (600 loc) · 36.1 KB
/
loadBalancer.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
// 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 elasticloadbalancingv2
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Load Balancer resource.
//
// > **Note:** `alb.LoadBalancer` is known as `lb.LoadBalancer`. The functionality is identical.
//
// ## Example Usage
// ### Specifying Elastic IPs
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/lb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := lb.NewLoadBalancer(ctx, "example", &lb.LoadBalancerArgs{
// LoadBalancerType: pulumi.String("network"),
// SubnetMappings: lb.LoadBalancerSubnetMappingArray{
// &lb.LoadBalancerSubnetMappingArgs{
// SubnetId: pulumi.Any(aws_subnet.Example1.Id),
// AllocationId: pulumi.Any(aws_eip.Example1.Id),
// },
// &lb.LoadBalancerSubnetMappingArgs{
// SubnetId: pulumi.Any(aws_subnet.Example2.Id),
// AllocationId: pulumi.Any(aws_eip.Example2.Id),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Specifying private IP addresses for an internal-facing load balancer
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/lb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := lb.NewLoadBalancer(ctx, "example", &lb.LoadBalancerArgs{
// LoadBalancerType: pulumi.String("network"),
// SubnetMappings: lb.LoadBalancerSubnetMappingArray{
// &lb.LoadBalancerSubnetMappingArgs{
// SubnetId: pulumi.Any(aws_subnet.Example1.Id),
// PrivateIpv4Address: pulumi.String("10.0.1.15"),
// },
// &lb.LoadBalancerSubnetMappingArgs{
// SubnetId: pulumi.Any(aws_subnet.Example2.Id),
// PrivateIpv4Address: pulumi.String("10.0.2.15"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// LBs can be imported using their ARN, e.g.,
//
// ```sh
//
// $ pulumi import aws:elasticloadbalancingv2/loadBalancer:LoadBalancer bar arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188
//
// ```
//
// Deprecated: aws.elasticloadbalancingv2.LoadBalancer has been deprecated in favor of aws.lb.LoadBalancer
type LoadBalancer struct {
pulumi.CustomResourceState
// An Access Logs block. Access Logs documented below.
AccessLogs LoadBalancerAccessLogsPtrOutput `pulumi:"accessLogs"`
// The ARN of the load balancer (matches `id`).
Arn pulumi.StringOutput `pulumi:"arn"`
// The ARN suffix for use with CloudWatch Metrics.
ArnSuffix pulumi.StringOutput `pulumi:"arnSuffix"`
// The ID of the customer owned ipv4 pool to use for this load balancer.
CustomerOwnedIpv4Pool pulumi.StringPtrOutput `pulumi:"customerOwnedIpv4Pool"`
// Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are `monitor`, `defensive` (default), `strictest`.
DesyncMitigationMode pulumi.StringPtrOutput `pulumi:"desyncMitigationMode"`
// The DNS name of the load balancer.
DnsName pulumi.StringOutput `pulumi:"dnsName"`
// Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type `application`.
DropInvalidHeaderFields pulumi.BoolPtrOutput `pulumi:"dropInvalidHeaderFields"`
// If true, cross-zone load balancing of the load balancer will be enabled.
// This is a `network` load balancer feature. Defaults to `false`.
EnableCrossZoneLoadBalancing pulumi.BoolPtrOutput `pulumi:"enableCrossZoneLoadBalancing"`
// If true, deletion of the load balancer will be disabled via
// the AWS API. This will prevent this provider from deleting the load balancer. Defaults to `false`.
EnableDeletionProtection pulumi.BoolPtrOutput `pulumi:"enableDeletionProtection"`
// Indicates whether HTTP/2 is enabled in `application` load balancers. Defaults to `true`.
EnableHttp2 pulumi.BoolPtrOutput `pulumi:"enableHttp2"`
// Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to `false`.
EnableWafFailOpen pulumi.BoolPtrOutput `pulumi:"enableWafFailOpen"`
// The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type `application`. Default: 60.
IdleTimeout pulumi.IntPtrOutput `pulumi:"idleTimeout"`
// If true, the LB will be internal.
Internal pulumi.BoolOutput `pulumi:"internal"`
// The type of IP addresses used by the subnets for your load balancer. The possible values are `ipv4` and `dualstack`
IpAddressType pulumi.StringOutput `pulumi:"ipAddressType"`
// The type of load balancer to create. Possible values are `application`, `gateway`, or `network`. The default value is `application`.
LoadBalancerType pulumi.StringPtrOutput `pulumi:"loadBalancerType"`
// The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters,
// must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified,
// this provider will autogenerate a name beginning with `tf-lb`.
Name pulumi.StringOutput `pulumi:"name"`
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
NamePrefix pulumi.StringPtrOutput `pulumi:"namePrefix"`
// Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to `false`.
PreserveHostHeader pulumi.BoolPtrOutput `pulumi:"preserveHostHeader"`
// A list of security group IDs to assign to the LB. Only valid for Load Balancers of type `application`.
SecurityGroups pulumi.StringArrayOutput `pulumi:"securityGroups"`
// A subnet mapping block as documented below.
SubnetMappings LoadBalancerSubnetMappingArrayOutput `pulumi:"subnetMappings"`
// A list of subnet IDs to attach to the LB. Subnets
// cannot be updated for Load Balancers of type `network`. Changing this value
// for load balancers of type `network` will force a recreation of the resource.
Subnets pulumi.StringArrayOutput `pulumi:"subnets"`
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
VpcId pulumi.StringOutput `pulumi:"vpcId"`
// The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
// * `subnet_mapping.*.outpost_id` - ID of the Outpost containing the load balancer.
ZoneId pulumi.StringOutput `pulumi:"zoneId"`
}
// NewLoadBalancer registers a new resource with the given unique name, arguments, and options.
func NewLoadBalancer(ctx *pulumi.Context,
name string, args *LoadBalancerArgs, opts ...pulumi.ResourceOption) (*LoadBalancer, error) {
if args == nil {
args = &LoadBalancerArgs{}
}
var resource LoadBalancer
err := ctx.RegisterResource("aws:elasticloadbalancingv2/loadBalancer:LoadBalancer", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLoadBalancer gets an existing LoadBalancer 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 GetLoadBalancer(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LoadBalancerState, opts ...pulumi.ResourceOption) (*LoadBalancer, error) {
var resource LoadBalancer
err := ctx.ReadResource("aws:elasticloadbalancingv2/loadBalancer:LoadBalancer", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering LoadBalancer resources.
type loadBalancerState struct {
// An Access Logs block. Access Logs documented below.
AccessLogs *LoadBalancerAccessLogs `pulumi:"accessLogs"`
// The ARN of the load balancer (matches `id`).
Arn *string `pulumi:"arn"`
// The ARN suffix for use with CloudWatch Metrics.
ArnSuffix *string `pulumi:"arnSuffix"`
// The ID of the customer owned ipv4 pool to use for this load balancer.
CustomerOwnedIpv4Pool *string `pulumi:"customerOwnedIpv4Pool"`
// Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are `monitor`, `defensive` (default), `strictest`.
DesyncMitigationMode *string `pulumi:"desyncMitigationMode"`
// The DNS name of the load balancer.
DnsName *string `pulumi:"dnsName"`
// Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type `application`.
DropInvalidHeaderFields *bool `pulumi:"dropInvalidHeaderFields"`
// If true, cross-zone load balancing of the load balancer will be enabled.
// This is a `network` load balancer feature. Defaults to `false`.
EnableCrossZoneLoadBalancing *bool `pulumi:"enableCrossZoneLoadBalancing"`
// If true, deletion of the load balancer will be disabled via
// the AWS API. This will prevent this provider from deleting the load balancer. Defaults to `false`.
EnableDeletionProtection *bool `pulumi:"enableDeletionProtection"`
// Indicates whether HTTP/2 is enabled in `application` load balancers. Defaults to `true`.
EnableHttp2 *bool `pulumi:"enableHttp2"`
// Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to `false`.
EnableWafFailOpen *bool `pulumi:"enableWafFailOpen"`
// The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type `application`. Default: 60.
IdleTimeout *int `pulumi:"idleTimeout"`
// If true, the LB will be internal.
Internal *bool `pulumi:"internal"`
// The type of IP addresses used by the subnets for your load balancer. The possible values are `ipv4` and `dualstack`
IpAddressType *string `pulumi:"ipAddressType"`
// The type of load balancer to create. Possible values are `application`, `gateway`, or `network`. The default value is `application`.
LoadBalancerType *string `pulumi:"loadBalancerType"`
// The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters,
// must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified,
// this provider will autogenerate a name beginning with `tf-lb`.
Name *string `pulumi:"name"`
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
NamePrefix *string `pulumi:"namePrefix"`
// Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to `false`.
PreserveHostHeader *bool `pulumi:"preserveHostHeader"`
// A list of security group IDs to assign to the LB. Only valid for Load Balancers of type `application`.
SecurityGroups []string `pulumi:"securityGroups"`
// A subnet mapping block as documented below.
SubnetMappings []LoadBalancerSubnetMapping `pulumi:"subnetMappings"`
// A list of subnet IDs to attach to the LB. Subnets
// cannot be updated for Load Balancers of type `network`. Changing this value
// for load balancers of type `network` will force a recreation of the resource.
Subnets []string `pulumi:"subnets"`
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll map[string]string `pulumi:"tagsAll"`
VpcId *string `pulumi:"vpcId"`
// The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
// * `subnet_mapping.*.outpost_id` - ID of the Outpost containing the load balancer.
ZoneId *string `pulumi:"zoneId"`
}
type LoadBalancerState struct {
// An Access Logs block. Access Logs documented below.
AccessLogs LoadBalancerAccessLogsPtrInput
// The ARN of the load balancer (matches `id`).
Arn pulumi.StringPtrInput
// The ARN suffix for use with CloudWatch Metrics.
ArnSuffix pulumi.StringPtrInput
// The ID of the customer owned ipv4 pool to use for this load balancer.
CustomerOwnedIpv4Pool pulumi.StringPtrInput
// Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are `monitor`, `defensive` (default), `strictest`.
DesyncMitigationMode pulumi.StringPtrInput
// The DNS name of the load balancer.
DnsName pulumi.StringPtrInput
// Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type `application`.
DropInvalidHeaderFields pulumi.BoolPtrInput
// If true, cross-zone load balancing of the load balancer will be enabled.
// This is a `network` load balancer feature. Defaults to `false`.
EnableCrossZoneLoadBalancing pulumi.BoolPtrInput
// If true, deletion of the load balancer will be disabled via
// the AWS API. This will prevent this provider from deleting the load balancer. Defaults to `false`.
EnableDeletionProtection pulumi.BoolPtrInput
// Indicates whether HTTP/2 is enabled in `application` load balancers. Defaults to `true`.
EnableHttp2 pulumi.BoolPtrInput
// Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to `false`.
EnableWafFailOpen pulumi.BoolPtrInput
// The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type `application`. Default: 60.
IdleTimeout pulumi.IntPtrInput
// If true, the LB will be internal.
Internal pulumi.BoolPtrInput
// The type of IP addresses used by the subnets for your load balancer. The possible values are `ipv4` and `dualstack`
IpAddressType pulumi.StringPtrInput
// The type of load balancer to create. Possible values are `application`, `gateway`, or `network`. The default value is `application`.
LoadBalancerType pulumi.StringPtrInput
// The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters,
// must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified,
// this provider will autogenerate a name beginning with `tf-lb`.
Name pulumi.StringPtrInput
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
NamePrefix pulumi.StringPtrInput
// Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to `false`.
PreserveHostHeader pulumi.BoolPtrInput
// A list of security group IDs to assign to the LB. Only valid for Load Balancers of type `application`.
SecurityGroups pulumi.StringArrayInput
// A subnet mapping block as documented below.
SubnetMappings LoadBalancerSubnetMappingArrayInput
// A list of subnet IDs to attach to the LB. Subnets
// cannot be updated for Load Balancers of type `network`. Changing this value
// for load balancers of type `network` will force a recreation of the resource.
Subnets pulumi.StringArrayInput
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapInput
VpcId pulumi.StringPtrInput
// The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
// * `subnet_mapping.*.outpost_id` - ID of the Outpost containing the load balancer.
ZoneId pulumi.StringPtrInput
}
func (LoadBalancerState) ElementType() reflect.Type {
return reflect.TypeOf((*loadBalancerState)(nil)).Elem()
}
type loadBalancerArgs struct {
// An Access Logs block. Access Logs documented below.
AccessLogs *LoadBalancerAccessLogs `pulumi:"accessLogs"`
// The ID of the customer owned ipv4 pool to use for this load balancer.
CustomerOwnedIpv4Pool *string `pulumi:"customerOwnedIpv4Pool"`
// Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are `monitor`, `defensive` (default), `strictest`.
DesyncMitigationMode *string `pulumi:"desyncMitigationMode"`
// Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type `application`.
DropInvalidHeaderFields *bool `pulumi:"dropInvalidHeaderFields"`
// If true, cross-zone load balancing of the load balancer will be enabled.
// This is a `network` load balancer feature. Defaults to `false`.
EnableCrossZoneLoadBalancing *bool `pulumi:"enableCrossZoneLoadBalancing"`
// If true, deletion of the load balancer will be disabled via
// the AWS API. This will prevent this provider from deleting the load balancer. Defaults to `false`.
EnableDeletionProtection *bool `pulumi:"enableDeletionProtection"`
// Indicates whether HTTP/2 is enabled in `application` load balancers. Defaults to `true`.
EnableHttp2 *bool `pulumi:"enableHttp2"`
// Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to `false`.
EnableWafFailOpen *bool `pulumi:"enableWafFailOpen"`
// The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type `application`. Default: 60.
IdleTimeout *int `pulumi:"idleTimeout"`
// If true, the LB will be internal.
Internal *bool `pulumi:"internal"`
// The type of IP addresses used by the subnets for your load balancer. The possible values are `ipv4` and `dualstack`
IpAddressType *string `pulumi:"ipAddressType"`
// The type of load balancer to create. Possible values are `application`, `gateway`, or `network`. The default value is `application`.
LoadBalancerType *string `pulumi:"loadBalancerType"`
// The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters,
// must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified,
// this provider will autogenerate a name beginning with `tf-lb`.
Name *string `pulumi:"name"`
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
NamePrefix *string `pulumi:"namePrefix"`
// Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to `false`.
PreserveHostHeader *bool `pulumi:"preserveHostHeader"`
// A list of security group IDs to assign to the LB. Only valid for Load Balancers of type `application`.
SecurityGroups []string `pulumi:"securityGroups"`
// A subnet mapping block as documented below.
SubnetMappings []LoadBalancerSubnetMapping `pulumi:"subnetMappings"`
// A list of subnet IDs to attach to the LB. Subnets
// cannot be updated for Load Balancers of type `network`. Changing this value
// for load balancers of type `network` will force a recreation of the resource.
Subnets []string `pulumi:"subnets"`
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a LoadBalancer resource.
type LoadBalancerArgs struct {
// An Access Logs block. Access Logs documented below.
AccessLogs LoadBalancerAccessLogsPtrInput
// The ID of the customer owned ipv4 pool to use for this load balancer.
CustomerOwnedIpv4Pool pulumi.StringPtrInput
// Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are `monitor`, `defensive` (default), `strictest`.
DesyncMitigationMode pulumi.StringPtrInput
// Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type `application`.
DropInvalidHeaderFields pulumi.BoolPtrInput
// If true, cross-zone load balancing of the load balancer will be enabled.
// This is a `network` load balancer feature. Defaults to `false`.
EnableCrossZoneLoadBalancing pulumi.BoolPtrInput
// If true, deletion of the load balancer will be disabled via
// the AWS API. This will prevent this provider from deleting the load balancer. Defaults to `false`.
EnableDeletionProtection pulumi.BoolPtrInput
// Indicates whether HTTP/2 is enabled in `application` load balancers. Defaults to `true`.
EnableHttp2 pulumi.BoolPtrInput
// Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to `false`.
EnableWafFailOpen pulumi.BoolPtrInput
// The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type `application`. Default: 60.
IdleTimeout pulumi.IntPtrInput
// If true, the LB will be internal.
Internal pulumi.BoolPtrInput
// The type of IP addresses used by the subnets for your load balancer. The possible values are `ipv4` and `dualstack`
IpAddressType pulumi.StringPtrInput
// The type of load balancer to create. Possible values are `application`, `gateway`, or `network`. The default value is `application`.
LoadBalancerType pulumi.StringPtrInput
// The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters,
// must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified,
// this provider will autogenerate a name beginning with `tf-lb`.
Name pulumi.StringPtrInput
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
NamePrefix pulumi.StringPtrInput
// Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to `false`.
PreserveHostHeader pulumi.BoolPtrInput
// A list of security group IDs to assign to the LB. Only valid for Load Balancers of type `application`.
SecurityGroups pulumi.StringArrayInput
// A subnet mapping block as documented below.
SubnetMappings LoadBalancerSubnetMappingArrayInput
// A list of subnet IDs to attach to the LB. Subnets
// cannot be updated for Load Balancers of type `network`. Changing this value
// for load balancers of type `network` will force a recreation of the resource.
Subnets pulumi.StringArrayInput
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
}
func (LoadBalancerArgs) ElementType() reflect.Type {
return reflect.TypeOf((*loadBalancerArgs)(nil)).Elem()
}
type LoadBalancerInput interface {
pulumi.Input
ToLoadBalancerOutput() LoadBalancerOutput
ToLoadBalancerOutputWithContext(ctx context.Context) LoadBalancerOutput
}
func (*LoadBalancer) ElementType() reflect.Type {
return reflect.TypeOf((**LoadBalancer)(nil)).Elem()
}
func (i *LoadBalancer) ToLoadBalancerOutput() LoadBalancerOutput {
return i.ToLoadBalancerOutputWithContext(context.Background())
}
func (i *LoadBalancer) ToLoadBalancerOutputWithContext(ctx context.Context) LoadBalancerOutput {
return pulumi.ToOutputWithContext(ctx, i).(LoadBalancerOutput)
}
// LoadBalancerArrayInput is an input type that accepts LoadBalancerArray and LoadBalancerArrayOutput values.
// You can construct a concrete instance of `LoadBalancerArrayInput` via:
//
// LoadBalancerArray{ LoadBalancerArgs{...} }
type LoadBalancerArrayInput interface {
pulumi.Input
ToLoadBalancerArrayOutput() LoadBalancerArrayOutput
ToLoadBalancerArrayOutputWithContext(context.Context) LoadBalancerArrayOutput
}
type LoadBalancerArray []LoadBalancerInput
func (LoadBalancerArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*LoadBalancer)(nil)).Elem()
}
func (i LoadBalancerArray) ToLoadBalancerArrayOutput() LoadBalancerArrayOutput {
return i.ToLoadBalancerArrayOutputWithContext(context.Background())
}
func (i LoadBalancerArray) ToLoadBalancerArrayOutputWithContext(ctx context.Context) LoadBalancerArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(LoadBalancerArrayOutput)
}
// LoadBalancerMapInput is an input type that accepts LoadBalancerMap and LoadBalancerMapOutput values.
// You can construct a concrete instance of `LoadBalancerMapInput` via:
//
// LoadBalancerMap{ "key": LoadBalancerArgs{...} }
type LoadBalancerMapInput interface {
pulumi.Input
ToLoadBalancerMapOutput() LoadBalancerMapOutput
ToLoadBalancerMapOutputWithContext(context.Context) LoadBalancerMapOutput
}
type LoadBalancerMap map[string]LoadBalancerInput
func (LoadBalancerMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*LoadBalancer)(nil)).Elem()
}
func (i LoadBalancerMap) ToLoadBalancerMapOutput() LoadBalancerMapOutput {
return i.ToLoadBalancerMapOutputWithContext(context.Background())
}
func (i LoadBalancerMap) ToLoadBalancerMapOutputWithContext(ctx context.Context) LoadBalancerMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(LoadBalancerMapOutput)
}
type LoadBalancerOutput struct{ *pulumi.OutputState }
func (LoadBalancerOutput) ElementType() reflect.Type {
return reflect.TypeOf((**LoadBalancer)(nil)).Elem()
}
func (o LoadBalancerOutput) ToLoadBalancerOutput() LoadBalancerOutput {
return o
}
func (o LoadBalancerOutput) ToLoadBalancerOutputWithContext(ctx context.Context) LoadBalancerOutput {
return o
}
// An Access Logs block. Access Logs documented below.
func (o LoadBalancerOutput) AccessLogs() LoadBalancerAccessLogsPtrOutput {
return o.ApplyT(func(v *LoadBalancer) LoadBalancerAccessLogsPtrOutput { return v.AccessLogs }).(LoadBalancerAccessLogsPtrOutput)
}
// The ARN of the load balancer (matches `id`).
func (o LoadBalancerOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// The ARN suffix for use with CloudWatch Metrics.
func (o LoadBalancerOutput) ArnSuffix() pulumi.StringOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringOutput { return v.ArnSuffix }).(pulumi.StringOutput)
}
// The ID of the customer owned ipv4 pool to use for this load balancer.
func (o LoadBalancerOutput) CustomerOwnedIpv4Pool() pulumi.StringPtrOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringPtrOutput { return v.CustomerOwnedIpv4Pool }).(pulumi.StringPtrOutput)
}
// Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are `monitor`, `defensive` (default), `strictest`.
func (o LoadBalancerOutput) DesyncMitigationMode() pulumi.StringPtrOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringPtrOutput { return v.DesyncMitigationMode }).(pulumi.StringPtrOutput)
}
// The DNS name of the load balancer.
func (o LoadBalancerOutput) DnsName() pulumi.StringOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringOutput { return v.DnsName }).(pulumi.StringOutput)
}
// Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type `application`.
func (o LoadBalancerOutput) DropInvalidHeaderFields() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.BoolPtrOutput { return v.DropInvalidHeaderFields }).(pulumi.BoolPtrOutput)
}
// If true, cross-zone load balancing of the load balancer will be enabled.
// This is a `network` load balancer feature. Defaults to `false`.
func (o LoadBalancerOutput) EnableCrossZoneLoadBalancing() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.BoolPtrOutput { return v.EnableCrossZoneLoadBalancing }).(pulumi.BoolPtrOutput)
}
// If true, deletion of the load balancer will be disabled via
// the AWS API. This will prevent this provider from deleting the load balancer. Defaults to `false`.
func (o LoadBalancerOutput) EnableDeletionProtection() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.BoolPtrOutput { return v.EnableDeletionProtection }).(pulumi.BoolPtrOutput)
}
// Indicates whether HTTP/2 is enabled in `application` load balancers. Defaults to `true`.
func (o LoadBalancerOutput) EnableHttp2() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.BoolPtrOutput { return v.EnableHttp2 }).(pulumi.BoolPtrOutput)
}
// Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to `false`.
func (o LoadBalancerOutput) EnableWafFailOpen() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.BoolPtrOutput { return v.EnableWafFailOpen }).(pulumi.BoolPtrOutput)
}
// The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type `application`. Default: 60.
func (o LoadBalancerOutput) IdleTimeout() pulumi.IntPtrOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.IntPtrOutput { return v.IdleTimeout }).(pulumi.IntPtrOutput)
}
// If true, the LB will be internal.
func (o LoadBalancerOutput) Internal() pulumi.BoolOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.BoolOutput { return v.Internal }).(pulumi.BoolOutput)
}
// The type of IP addresses used by the subnets for your load balancer. The possible values are `ipv4` and `dualstack`
func (o LoadBalancerOutput) IpAddressType() pulumi.StringOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringOutput { return v.IpAddressType }).(pulumi.StringOutput)
}
// The type of load balancer to create. Possible values are `application`, `gateway`, or `network`. The default value is `application`.
func (o LoadBalancerOutput) LoadBalancerType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringPtrOutput { return v.LoadBalancerType }).(pulumi.StringPtrOutput)
}
// The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters,
// must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified,
// this provider will autogenerate a name beginning with `tf-lb`.
func (o LoadBalancerOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
func (o LoadBalancerOutput) NamePrefix() pulumi.StringPtrOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringPtrOutput { return v.NamePrefix }).(pulumi.StringPtrOutput)
}
// Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to `false`.
func (o LoadBalancerOutput) PreserveHostHeader() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.BoolPtrOutput { return v.PreserveHostHeader }).(pulumi.BoolPtrOutput)
}
// A list of security group IDs to assign to the LB. Only valid for Load Balancers of type `application`.
func (o LoadBalancerOutput) SecurityGroups() pulumi.StringArrayOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringArrayOutput { return v.SecurityGroups }).(pulumi.StringArrayOutput)
}
// A subnet mapping block as documented below.
func (o LoadBalancerOutput) SubnetMappings() LoadBalancerSubnetMappingArrayOutput {
return o.ApplyT(func(v *LoadBalancer) LoadBalancerSubnetMappingArrayOutput { return v.SubnetMappings }).(LoadBalancerSubnetMappingArrayOutput)
}
// A list of subnet IDs to attach to the LB. Subnets
// cannot be updated for Load Balancers of type `network`. Changing this value
// for load balancers of type `network` will force a recreation of the resource.
func (o LoadBalancerOutput) Subnets() pulumi.StringArrayOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringArrayOutput { return v.Subnets }).(pulumi.StringArrayOutput)
}
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
func (o LoadBalancerOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
func (o LoadBalancerOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
func (o LoadBalancerOutput) VpcId() pulumi.StringOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput)
}
// The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
// * `subnet_mapping.*.outpost_id` - ID of the Outpost containing the load balancer.
func (o LoadBalancerOutput) ZoneId() pulumi.StringOutput {
return o.ApplyT(func(v *LoadBalancer) pulumi.StringOutput { return v.ZoneId }).(pulumi.StringOutput)
}
type LoadBalancerArrayOutput struct{ *pulumi.OutputState }
func (LoadBalancerArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*LoadBalancer)(nil)).Elem()
}
func (o LoadBalancerArrayOutput) ToLoadBalancerArrayOutput() LoadBalancerArrayOutput {
return o
}
func (o LoadBalancerArrayOutput) ToLoadBalancerArrayOutputWithContext(ctx context.Context) LoadBalancerArrayOutput {
return o
}
func (o LoadBalancerArrayOutput) Index(i pulumi.IntInput) LoadBalancerOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *LoadBalancer {
return vs[0].([]*LoadBalancer)[vs[1].(int)]
}).(LoadBalancerOutput)
}
type LoadBalancerMapOutput struct{ *pulumi.OutputState }
func (LoadBalancerMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*LoadBalancer)(nil)).Elem()
}
func (o LoadBalancerMapOutput) ToLoadBalancerMapOutput() LoadBalancerMapOutput {
return o
}
func (o LoadBalancerMapOutput) ToLoadBalancerMapOutputWithContext(ctx context.Context) LoadBalancerMapOutput {
return o
}
func (o LoadBalancerMapOutput) MapIndex(k pulumi.StringInput) LoadBalancerOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *LoadBalancer {
return vs[0].(map[string]*LoadBalancer)[vs[1].(string)]
}).(LoadBalancerOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*LoadBalancerInput)(nil)).Elem(), &LoadBalancer{})
pulumi.RegisterInputType(reflect.TypeOf((*LoadBalancerArrayInput)(nil)).Elem(), LoadBalancerArray{})
pulumi.RegisterInputType(reflect.TypeOf((*LoadBalancerMapInput)(nil)).Elem(), LoadBalancerMap{})
pulumi.RegisterOutputType(LoadBalancerOutput{})
pulumi.RegisterOutputType(LoadBalancerArrayOutput{})
pulumi.RegisterOutputType(LoadBalancerMapOutput{})
}