-
Notifications
You must be signed in to change notification settings - Fork 151
/
targetGroup.go
654 lines (586 loc) · 38.6 KB
/
targetGroup.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
// 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 Target Group resource for use with Load Balancer resources.
//
// > **Note:** `alb.TargetGroup` is known as `lb.TargetGroup`. The functionality is identical.
//
// ## Example Usage
// ### Instance Target Group
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
// "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 {
// main, err := ec2.NewVpc(ctx, "main", &ec2.VpcArgs{
// CidrBlock: pulumi.String("10.0.0.0/16"),
// })
// if err != nil {
// return err
// }
// _, err = lb.NewTargetGroup(ctx, "test", &lb.TargetGroupArgs{
// Port: pulumi.Int(80),
// Protocol: pulumi.String("HTTP"),
// VpcId: main.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### IP Target Group
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
// "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 {
// main, err := ec2.NewVpc(ctx, "main", &ec2.VpcArgs{
// CidrBlock: pulumi.String("10.0.0.0/16"),
// })
// if err != nil {
// return err
// }
// _, err = lb.NewTargetGroup(ctx, "ip-example", &lb.TargetGroupArgs{
// Port: pulumi.Int(80),
// Protocol: pulumi.String("HTTP"),
// TargetType: pulumi.String("ip"),
// VpcId: main.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Lambda Target Group
//
// ```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.NewTargetGroup(ctx, "lambda-example", &lb.TargetGroupArgs{
// TargetType: pulumi.String("lambda"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### ALB Target Group
//
// ```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.NewTargetGroup(ctx, "alb-example", &lb.TargetGroupArgs{
// TargetType: pulumi.String("alb"),
// Port: pulumi.Int(80),
// Protocol: pulumi.String("TCP"),
// VpcId: pulumi.Any(aws_vpc.Main.Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Target Groups can be imported using their ARN, e.g.,
//
// ```sh
//
// $ pulumi import aws:elasticloadbalancingv2/targetGroup:TargetGroup app_front_end arn:aws:elasticloadbalancing:us-west-2:187416307283:targetgroup/app-front-end/20cfe21448b66314
//
// ```
//
// Deprecated: aws.elasticloadbalancingv2.TargetGroup has been deprecated in favor of aws.lb.TargetGroup
type TargetGroup struct {
pulumi.CustomResourceState
// ARN of the Target Group (matches `id`).
Arn pulumi.StringOutput `pulumi:"arn"`
// ARN suffix for use with CloudWatch Metrics.
ArnSuffix pulumi.StringOutput `pulumi:"arnSuffix"`
// Whether to terminate connections at the end of the deregistration timeout on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#deregistration-delay) for more information. Default is `false`.
ConnectionTermination pulumi.BoolPtrOutput `pulumi:"connectionTermination"`
// Amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.
DeregistrationDelay pulumi.IntPtrOutput `pulumi:"deregistrationDelay"`
// Health Check configuration block. Detailed below.
HealthCheck TargetGroupHealthCheckOutput `pulumi:"healthCheck"`
// The type of IP addresses used by the target group, only supported when target type is set to `ip`. Possible values are `ipv4` or `ipv6`.
IpAddressType pulumi.StringOutput `pulumi:"ipAddressType"`
// Whether the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings. Only applies when `targetType` is `lambda`. Default is `false`.
LambdaMultiValueHeadersEnabled pulumi.BoolPtrOutput `pulumi:"lambdaMultiValueHeadersEnabled"`
// Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is `roundRobin` or `leastOutstandingRequests`. The default is `roundRobin`.
LoadBalancingAlgorithmType pulumi.StringOutput `pulumi:"loadBalancingAlgorithmType"`
// Name of the target group. If omitted, this provider will assign a random, unique name.
Name pulumi.StringOutput `pulumi:"name"`
// Creates a unique name beginning with the specified prefix. Conflicts with `name`. Cannot be longer than 6 characters.
NamePrefix pulumi.StringPtrOutput `pulumi:"namePrefix"`
// Port on which targets receive traffic, unless overridden when registering a specific target. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
Port pulumi.IntPtrOutput `pulumi:"port"`
// Whether client IP preservation is enabled. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#client-ip-preservation) for more information.
PreserveClientIp pulumi.StringOutput `pulumi:"preserveClientIp"`
// Protocol to use for routing traffic to the targets. Should be one of `GENEVE`, `HTTP`, `HTTPS`, `TCP`, `TCP_UDP`, `TLS`, or `UDP`. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
Protocol pulumi.StringPtrOutput `pulumi:"protocol"`
// Only applicable when `protocol` is `HTTP` or `HTTPS`. The protocol version. Specify `GRPC` to send requests to targets using gRPC. Specify `HTTP2` to send requests to targets using HTTP/2. The default is `HTTP1`, which sends requests to targets using HTTP/1.1
ProtocolVersion pulumi.StringOutput `pulumi:"protocolVersion"`
// Whether to enable support for proxy protocol v2 on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#proxy-protocol) for more information. Default is `false`.
ProxyProtocolV2 pulumi.BoolPtrOutput `pulumi:"proxyProtocolV2"`
// Amount time for targets to warm up before the load balancer sends them a full share of requests. The range is 30-900 seconds or 0 to disable. The default value is 0 seconds.
SlowStart pulumi.IntPtrOutput `pulumi:"slowStart"`
// Stickiness configuration block. Detailed below.
Stickiness TargetGroupStickinessOutput `pulumi:"stickiness"`
// 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"`
// Target failover block. Only applicable for Gateway Load Balancer target groups. See targetFailover for more information.
TargetFailovers TargetGroupTargetFailoverArrayOutput `pulumi:"targetFailovers"`
// Type of target that you must specify when registering targets with this target group. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html) for supported values. The default is `instance`.
TargetType pulumi.StringPtrOutput `pulumi:"targetType"`
// Identifier of the VPC in which to create the target group. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
VpcId pulumi.StringPtrOutput `pulumi:"vpcId"`
}
// NewTargetGroup registers a new resource with the given unique name, arguments, and options.
func NewTargetGroup(ctx *pulumi.Context,
name string, args *TargetGroupArgs, opts ...pulumi.ResourceOption) (*TargetGroup, error) {
if args == nil {
args = &TargetGroupArgs{}
}
var resource TargetGroup
err := ctx.RegisterResource("aws:elasticloadbalancingv2/targetGroup:TargetGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTargetGroup gets an existing TargetGroup 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 GetTargetGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TargetGroupState, opts ...pulumi.ResourceOption) (*TargetGroup, error) {
var resource TargetGroup
err := ctx.ReadResource("aws:elasticloadbalancingv2/targetGroup:TargetGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering TargetGroup resources.
type targetGroupState struct {
// ARN of the Target Group (matches `id`).
Arn *string `pulumi:"arn"`
// ARN suffix for use with CloudWatch Metrics.
ArnSuffix *string `pulumi:"arnSuffix"`
// Whether to terminate connections at the end of the deregistration timeout on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#deregistration-delay) for more information. Default is `false`.
ConnectionTermination *bool `pulumi:"connectionTermination"`
// Amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.
DeregistrationDelay *int `pulumi:"deregistrationDelay"`
// Health Check configuration block. Detailed below.
HealthCheck *TargetGroupHealthCheck `pulumi:"healthCheck"`
// The type of IP addresses used by the target group, only supported when target type is set to `ip`. Possible values are `ipv4` or `ipv6`.
IpAddressType *string `pulumi:"ipAddressType"`
// Whether the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings. Only applies when `targetType` is `lambda`. Default is `false`.
LambdaMultiValueHeadersEnabled *bool `pulumi:"lambdaMultiValueHeadersEnabled"`
// Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is `roundRobin` or `leastOutstandingRequests`. The default is `roundRobin`.
LoadBalancingAlgorithmType *string `pulumi:"loadBalancingAlgorithmType"`
// Name of the target group. If omitted, this provider will assign a random, unique name.
Name *string `pulumi:"name"`
// Creates a unique name beginning with the specified prefix. Conflicts with `name`. Cannot be longer than 6 characters.
NamePrefix *string `pulumi:"namePrefix"`
// Port on which targets receive traffic, unless overridden when registering a specific target. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
Port *int `pulumi:"port"`
// Whether client IP preservation is enabled. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#client-ip-preservation) for more information.
PreserveClientIp *string `pulumi:"preserveClientIp"`
// Protocol to use for routing traffic to the targets. Should be one of `GENEVE`, `HTTP`, `HTTPS`, `TCP`, `TCP_UDP`, `TLS`, or `UDP`. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
Protocol *string `pulumi:"protocol"`
// Only applicable when `protocol` is `HTTP` or `HTTPS`. The protocol version. Specify `GRPC` to send requests to targets using gRPC. Specify `HTTP2` to send requests to targets using HTTP/2. The default is `HTTP1`, which sends requests to targets using HTTP/1.1
ProtocolVersion *string `pulumi:"protocolVersion"`
// Whether to enable support for proxy protocol v2 on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#proxy-protocol) for more information. Default is `false`.
ProxyProtocolV2 *bool `pulumi:"proxyProtocolV2"`
// Amount time for targets to warm up before the load balancer sends them a full share of requests. The range is 30-900 seconds or 0 to disable. The default value is 0 seconds.
SlowStart *int `pulumi:"slowStart"`
// Stickiness configuration block. Detailed below.
Stickiness *TargetGroupStickiness `pulumi:"stickiness"`
// 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"`
// Target failover block. Only applicable for Gateway Load Balancer target groups. See targetFailover for more information.
TargetFailovers []TargetGroupTargetFailover `pulumi:"targetFailovers"`
// Type of target that you must specify when registering targets with this target group. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html) for supported values. The default is `instance`.
TargetType *string `pulumi:"targetType"`
// Identifier of the VPC in which to create the target group. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
VpcId *string `pulumi:"vpcId"`
}
type TargetGroupState struct {
// ARN of the Target Group (matches `id`).
Arn pulumi.StringPtrInput
// ARN suffix for use with CloudWatch Metrics.
ArnSuffix pulumi.StringPtrInput
// Whether to terminate connections at the end of the deregistration timeout on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#deregistration-delay) for more information. Default is `false`.
ConnectionTermination pulumi.BoolPtrInput
// Amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.
DeregistrationDelay pulumi.IntPtrInput
// Health Check configuration block. Detailed below.
HealthCheck TargetGroupHealthCheckPtrInput
// The type of IP addresses used by the target group, only supported when target type is set to `ip`. Possible values are `ipv4` or `ipv6`.
IpAddressType pulumi.StringPtrInput
// Whether the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings. Only applies when `targetType` is `lambda`. Default is `false`.
LambdaMultiValueHeadersEnabled pulumi.BoolPtrInput
// Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is `roundRobin` or `leastOutstandingRequests`. The default is `roundRobin`.
LoadBalancingAlgorithmType pulumi.StringPtrInput
// Name of the target group. If omitted, this provider will assign a random, unique name.
Name pulumi.StringPtrInput
// Creates a unique name beginning with the specified prefix. Conflicts with `name`. Cannot be longer than 6 characters.
NamePrefix pulumi.StringPtrInput
// Port on which targets receive traffic, unless overridden when registering a specific target. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
Port pulumi.IntPtrInput
// Whether client IP preservation is enabled. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#client-ip-preservation) for more information.
PreserveClientIp pulumi.StringPtrInput
// Protocol to use for routing traffic to the targets. Should be one of `GENEVE`, `HTTP`, `HTTPS`, `TCP`, `TCP_UDP`, `TLS`, or `UDP`. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
Protocol pulumi.StringPtrInput
// Only applicable when `protocol` is `HTTP` or `HTTPS`. The protocol version. Specify `GRPC` to send requests to targets using gRPC. Specify `HTTP2` to send requests to targets using HTTP/2. The default is `HTTP1`, which sends requests to targets using HTTP/1.1
ProtocolVersion pulumi.StringPtrInput
// Whether to enable support for proxy protocol v2 on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#proxy-protocol) for more information. Default is `false`.
ProxyProtocolV2 pulumi.BoolPtrInput
// Amount time for targets to warm up before the load balancer sends them a full share of requests. The range is 30-900 seconds or 0 to disable. The default value is 0 seconds.
SlowStart pulumi.IntPtrInput
// Stickiness configuration block. Detailed below.
Stickiness TargetGroupStickinessPtrInput
// 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
// Target failover block. Only applicable for Gateway Load Balancer target groups. See targetFailover for more information.
TargetFailovers TargetGroupTargetFailoverArrayInput
// Type of target that you must specify when registering targets with this target group. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html) for supported values. The default is `instance`.
TargetType pulumi.StringPtrInput
// Identifier of the VPC in which to create the target group. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
VpcId pulumi.StringPtrInput
}
func (TargetGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*targetGroupState)(nil)).Elem()
}
type targetGroupArgs struct {
// Whether to terminate connections at the end of the deregistration timeout on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#deregistration-delay) for more information. Default is `false`.
ConnectionTermination *bool `pulumi:"connectionTermination"`
// Amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.
DeregistrationDelay *int `pulumi:"deregistrationDelay"`
// Health Check configuration block. Detailed below.
HealthCheck *TargetGroupHealthCheck `pulumi:"healthCheck"`
// The type of IP addresses used by the target group, only supported when target type is set to `ip`. Possible values are `ipv4` or `ipv6`.
IpAddressType *string `pulumi:"ipAddressType"`
// Whether the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings. Only applies when `targetType` is `lambda`. Default is `false`.
LambdaMultiValueHeadersEnabled *bool `pulumi:"lambdaMultiValueHeadersEnabled"`
// Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is `roundRobin` or `leastOutstandingRequests`. The default is `roundRobin`.
LoadBalancingAlgorithmType *string `pulumi:"loadBalancingAlgorithmType"`
// Name of the target group. If omitted, this provider will assign a random, unique name.
Name *string `pulumi:"name"`
// Creates a unique name beginning with the specified prefix. Conflicts with `name`. Cannot be longer than 6 characters.
NamePrefix *string `pulumi:"namePrefix"`
// Port on which targets receive traffic, unless overridden when registering a specific target. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
Port *int `pulumi:"port"`
// Whether client IP preservation is enabled. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#client-ip-preservation) for more information.
PreserveClientIp *string `pulumi:"preserveClientIp"`
// Protocol to use for routing traffic to the targets. Should be one of `GENEVE`, `HTTP`, `HTTPS`, `TCP`, `TCP_UDP`, `TLS`, or `UDP`. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
Protocol *string `pulumi:"protocol"`
// Only applicable when `protocol` is `HTTP` or `HTTPS`. The protocol version. Specify `GRPC` to send requests to targets using gRPC. Specify `HTTP2` to send requests to targets using HTTP/2. The default is `HTTP1`, which sends requests to targets using HTTP/1.1
ProtocolVersion *string `pulumi:"protocolVersion"`
// Whether to enable support for proxy protocol v2 on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#proxy-protocol) for more information. Default is `false`.
ProxyProtocolV2 *bool `pulumi:"proxyProtocolV2"`
// Amount time for targets to warm up before the load balancer sends them a full share of requests. The range is 30-900 seconds or 0 to disable. The default value is 0 seconds.
SlowStart *int `pulumi:"slowStart"`
// Stickiness configuration block. Detailed below.
Stickiness *TargetGroupStickiness `pulumi:"stickiness"`
// 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"`
// Target failover block. Only applicable for Gateway Load Balancer target groups. See targetFailover for more information.
TargetFailovers []TargetGroupTargetFailover `pulumi:"targetFailovers"`
// Type of target that you must specify when registering targets with this target group. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html) for supported values. The default is `instance`.
TargetType *string `pulumi:"targetType"`
// Identifier of the VPC in which to create the target group. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
VpcId *string `pulumi:"vpcId"`
}
// The set of arguments for constructing a TargetGroup resource.
type TargetGroupArgs struct {
// Whether to terminate connections at the end of the deregistration timeout on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#deregistration-delay) for more information. Default is `false`.
ConnectionTermination pulumi.BoolPtrInput
// Amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.
DeregistrationDelay pulumi.IntPtrInput
// Health Check configuration block. Detailed below.
HealthCheck TargetGroupHealthCheckPtrInput
// The type of IP addresses used by the target group, only supported when target type is set to `ip`. Possible values are `ipv4` or `ipv6`.
IpAddressType pulumi.StringPtrInput
// Whether the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings. Only applies when `targetType` is `lambda`. Default is `false`.
LambdaMultiValueHeadersEnabled pulumi.BoolPtrInput
// Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is `roundRobin` or `leastOutstandingRequests`. The default is `roundRobin`.
LoadBalancingAlgorithmType pulumi.StringPtrInput
// Name of the target group. If omitted, this provider will assign a random, unique name.
Name pulumi.StringPtrInput
// Creates a unique name beginning with the specified prefix. Conflicts with `name`. Cannot be longer than 6 characters.
NamePrefix pulumi.StringPtrInput
// Port on which targets receive traffic, unless overridden when registering a specific target. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
Port pulumi.IntPtrInput
// Whether client IP preservation is enabled. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#client-ip-preservation) for more information.
PreserveClientIp pulumi.StringPtrInput
// Protocol to use for routing traffic to the targets. Should be one of `GENEVE`, `HTTP`, `HTTPS`, `TCP`, `TCP_UDP`, `TLS`, or `UDP`. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
Protocol pulumi.StringPtrInput
// Only applicable when `protocol` is `HTTP` or `HTTPS`. The protocol version. Specify `GRPC` to send requests to targets using gRPC. Specify `HTTP2` to send requests to targets using HTTP/2. The default is `HTTP1`, which sends requests to targets using HTTP/1.1
ProtocolVersion pulumi.StringPtrInput
// Whether to enable support for proxy protocol v2 on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#proxy-protocol) for more information. Default is `false`.
ProxyProtocolV2 pulumi.BoolPtrInput
// Amount time for targets to warm up before the load balancer sends them a full share of requests. The range is 30-900 seconds or 0 to disable. The default value is 0 seconds.
SlowStart pulumi.IntPtrInput
// Stickiness configuration block. Detailed below.
Stickiness TargetGroupStickinessPtrInput
// 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
// Target failover block. Only applicable for Gateway Load Balancer target groups. See targetFailover for more information.
TargetFailovers TargetGroupTargetFailoverArrayInput
// Type of target that you must specify when registering targets with this target group. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html) for supported values. The default is `instance`.
TargetType pulumi.StringPtrInput
// Identifier of the VPC in which to create the target group. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
VpcId pulumi.StringPtrInput
}
func (TargetGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*targetGroupArgs)(nil)).Elem()
}
type TargetGroupInput interface {
pulumi.Input
ToTargetGroupOutput() TargetGroupOutput
ToTargetGroupOutputWithContext(ctx context.Context) TargetGroupOutput
}
func (*TargetGroup) ElementType() reflect.Type {
return reflect.TypeOf((**TargetGroup)(nil)).Elem()
}
func (i *TargetGroup) ToTargetGroupOutput() TargetGroupOutput {
return i.ToTargetGroupOutputWithContext(context.Background())
}
func (i *TargetGroup) ToTargetGroupOutputWithContext(ctx context.Context) TargetGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(TargetGroupOutput)
}
// TargetGroupArrayInput is an input type that accepts TargetGroupArray and TargetGroupArrayOutput values.
// You can construct a concrete instance of `TargetGroupArrayInput` via:
//
// TargetGroupArray{ TargetGroupArgs{...} }
type TargetGroupArrayInput interface {
pulumi.Input
ToTargetGroupArrayOutput() TargetGroupArrayOutput
ToTargetGroupArrayOutputWithContext(context.Context) TargetGroupArrayOutput
}
type TargetGroupArray []TargetGroupInput
func (TargetGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TargetGroup)(nil)).Elem()
}
func (i TargetGroupArray) ToTargetGroupArrayOutput() TargetGroupArrayOutput {
return i.ToTargetGroupArrayOutputWithContext(context.Background())
}
func (i TargetGroupArray) ToTargetGroupArrayOutputWithContext(ctx context.Context) TargetGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(TargetGroupArrayOutput)
}
// TargetGroupMapInput is an input type that accepts TargetGroupMap and TargetGroupMapOutput values.
// You can construct a concrete instance of `TargetGroupMapInput` via:
//
// TargetGroupMap{ "key": TargetGroupArgs{...} }
type TargetGroupMapInput interface {
pulumi.Input
ToTargetGroupMapOutput() TargetGroupMapOutput
ToTargetGroupMapOutputWithContext(context.Context) TargetGroupMapOutput
}
type TargetGroupMap map[string]TargetGroupInput
func (TargetGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TargetGroup)(nil)).Elem()
}
func (i TargetGroupMap) ToTargetGroupMapOutput() TargetGroupMapOutput {
return i.ToTargetGroupMapOutputWithContext(context.Background())
}
func (i TargetGroupMap) ToTargetGroupMapOutputWithContext(ctx context.Context) TargetGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(TargetGroupMapOutput)
}
type TargetGroupOutput struct{ *pulumi.OutputState }
func (TargetGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**TargetGroup)(nil)).Elem()
}
func (o TargetGroupOutput) ToTargetGroupOutput() TargetGroupOutput {
return o
}
func (o TargetGroupOutput) ToTargetGroupOutputWithContext(ctx context.Context) TargetGroupOutput {
return o
}
// ARN of the Target Group (matches `id`).
func (o TargetGroupOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// ARN suffix for use with CloudWatch Metrics.
func (o TargetGroupOutput) ArnSuffix() pulumi.StringOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringOutput { return v.ArnSuffix }).(pulumi.StringOutput)
}
// Whether to terminate connections at the end of the deregistration timeout on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#deregistration-delay) for more information. Default is `false`.
func (o TargetGroupOutput) ConnectionTermination() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.BoolPtrOutput { return v.ConnectionTermination }).(pulumi.BoolPtrOutput)
}
// Amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.
func (o TargetGroupOutput) DeregistrationDelay() pulumi.IntPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.IntPtrOutput { return v.DeregistrationDelay }).(pulumi.IntPtrOutput)
}
// Health Check configuration block. Detailed below.
func (o TargetGroupOutput) HealthCheck() TargetGroupHealthCheckOutput {
return o.ApplyT(func(v *TargetGroup) TargetGroupHealthCheckOutput { return v.HealthCheck }).(TargetGroupHealthCheckOutput)
}
// The type of IP addresses used by the target group, only supported when target type is set to `ip`. Possible values are `ipv4` or `ipv6`.
func (o TargetGroupOutput) IpAddressType() pulumi.StringOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringOutput { return v.IpAddressType }).(pulumi.StringOutput)
}
// Whether the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings. Only applies when `targetType` is `lambda`. Default is `false`.
func (o TargetGroupOutput) LambdaMultiValueHeadersEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.BoolPtrOutput { return v.LambdaMultiValueHeadersEnabled }).(pulumi.BoolPtrOutput)
}
// Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is `roundRobin` or `leastOutstandingRequests`. The default is `roundRobin`.
func (o TargetGroupOutput) LoadBalancingAlgorithmType() pulumi.StringOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringOutput { return v.LoadBalancingAlgorithmType }).(pulumi.StringOutput)
}
// Name of the target group. If omitted, this provider will assign a random, unique name.
func (o TargetGroupOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Creates a unique name beginning with the specified prefix. Conflicts with `name`. Cannot be longer than 6 characters.
func (o TargetGroupOutput) NamePrefix() pulumi.StringPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringPtrOutput { return v.NamePrefix }).(pulumi.StringPtrOutput)
}
// Port on which targets receive traffic, unless overridden when registering a specific target. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
func (o TargetGroupOutput) Port() pulumi.IntPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.IntPtrOutput { return v.Port }).(pulumi.IntPtrOutput)
}
// Whether client IP preservation is enabled. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#client-ip-preservation) for more information.
func (o TargetGroupOutput) PreserveClientIp() pulumi.StringOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringOutput { return v.PreserveClientIp }).(pulumi.StringOutput)
}
// Protocol to use for routing traffic to the targets. Should be one of `GENEVE`, `HTTP`, `HTTPS`, `TCP`, `TCP_UDP`, `TLS`, or `UDP`. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
func (o TargetGroupOutput) Protocol() pulumi.StringPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringPtrOutput { return v.Protocol }).(pulumi.StringPtrOutput)
}
// Only applicable when `protocol` is `HTTP` or `HTTPS`. The protocol version. Specify `GRPC` to send requests to targets using gRPC. Specify `HTTP2` to send requests to targets using HTTP/2. The default is `HTTP1`, which sends requests to targets using HTTP/1.1
func (o TargetGroupOutput) ProtocolVersion() pulumi.StringOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringOutput { return v.ProtocolVersion }).(pulumi.StringOutput)
}
// Whether to enable support for proxy protocol v2 on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#proxy-protocol) for more information. Default is `false`.
func (o TargetGroupOutput) ProxyProtocolV2() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.BoolPtrOutput { return v.ProxyProtocolV2 }).(pulumi.BoolPtrOutput)
}
// Amount time for targets to warm up before the load balancer sends them a full share of requests. The range is 30-900 seconds or 0 to disable. The default value is 0 seconds.
func (o TargetGroupOutput) SlowStart() pulumi.IntPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.IntPtrOutput { return v.SlowStart }).(pulumi.IntPtrOutput)
}
// Stickiness configuration block. Detailed below.
func (o TargetGroupOutput) Stickiness() TargetGroupStickinessOutput {
return o.ApplyT(func(v *TargetGroup) TargetGroupStickinessOutput { return v.Stickiness }).(TargetGroupStickinessOutput)
}
// 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 TargetGroupOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *TargetGroup) 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 TargetGroupOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
// Target failover block. Only applicable for Gateway Load Balancer target groups. See targetFailover for more information.
func (o TargetGroupOutput) TargetFailovers() TargetGroupTargetFailoverArrayOutput {
return o.ApplyT(func(v *TargetGroup) TargetGroupTargetFailoverArrayOutput { return v.TargetFailovers }).(TargetGroupTargetFailoverArrayOutput)
}
// Type of target that you must specify when registering targets with this target group. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html) for supported values. The default is `instance`.
func (o TargetGroupOutput) TargetType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringPtrOutput { return v.TargetType }).(pulumi.StringPtrOutput)
}
// Identifier of the VPC in which to create the target group. Required when `targetType` is `instance`, `ip` or `alb`. Does not apply when `targetType` is `lambda`.
func (o TargetGroupOutput) VpcId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringPtrOutput { return v.VpcId }).(pulumi.StringPtrOutput)
}
type TargetGroupArrayOutput struct{ *pulumi.OutputState }
func (TargetGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TargetGroup)(nil)).Elem()
}
func (o TargetGroupArrayOutput) ToTargetGroupArrayOutput() TargetGroupArrayOutput {
return o
}
func (o TargetGroupArrayOutput) ToTargetGroupArrayOutputWithContext(ctx context.Context) TargetGroupArrayOutput {
return o
}
func (o TargetGroupArrayOutput) Index(i pulumi.IntInput) TargetGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *TargetGroup {
return vs[0].([]*TargetGroup)[vs[1].(int)]
}).(TargetGroupOutput)
}
type TargetGroupMapOutput struct{ *pulumi.OutputState }
func (TargetGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TargetGroup)(nil)).Elem()
}
func (o TargetGroupMapOutput) ToTargetGroupMapOutput() TargetGroupMapOutput {
return o
}
func (o TargetGroupMapOutput) ToTargetGroupMapOutputWithContext(ctx context.Context) TargetGroupMapOutput {
return o
}
func (o TargetGroupMapOutput) MapIndex(k pulumi.StringInput) TargetGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *TargetGroup {
return vs[0].(map[string]*TargetGroup)[vs[1].(string)]
}).(TargetGroupOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*TargetGroupInput)(nil)).Elem(), &TargetGroup{})
pulumi.RegisterInputType(reflect.TypeOf((*TargetGroupArrayInput)(nil)).Elem(), TargetGroupArray{})
pulumi.RegisterInputType(reflect.TypeOf((*TargetGroupMapInput)(nil)).Elem(), TargetGroupMap{})
pulumi.RegisterOutputType(TargetGroupOutput{})
pulumi.RegisterOutputType(TargetGroupArrayOutput{})
pulumi.RegisterOutputType(TargetGroupMapOutput{})
}