@@ -386,6 +386,8 @@ func Test_buildSDKCreateTargetGroupInput(t *testing.T) {
386
386
port9090 := intstr .FromInt (9090 )
387
387
protocolHTTP := elbv2model .ProtocolHTTP
388
388
protocolVersionHTTP2 := elbv2model .ProtocolVersionHTTP2
389
+ ipAddressTypeIPv4 := elbv2model .TargetGroupIPAddressTypeIPv4
390
+ ipAddressTypeIPv6 := elbv2model .TargetGroupIPAddressTypeIPv6
389
391
type args struct {
390
392
tgSpec elbv2model.TargetGroupSpec
391
393
}
@@ -398,10 +400,11 @@ func Test_buildSDKCreateTargetGroupInput(t *testing.T) {
398
400
name : "standard case" ,
399
401
args : args {
400
402
tgSpec : elbv2model.TargetGroupSpec {
401
- Name : "my-tg" ,
402
- TargetType : elbv2model .TargetTypeIP ,
403
- Port : 8080 ,
404
- Protocol : elbv2model .ProtocolHTTP ,
403
+ Name : "my-tg" ,
404
+ TargetType : elbv2model .TargetTypeIP ,
405
+ Port : 8080 ,
406
+ Protocol : elbv2model .ProtocolHTTP ,
407
+ IPAddressType : & ipAddressTypeIPv4 ,
405
408
HealthCheckConfig : & elbv2model.TargetGroupHealthCheckConfig {
406
409
Port : & port9090 ,
407
410
Protocol : & protocolHTTP ,
@@ -468,6 +471,44 @@ func Test_buildSDKCreateTargetGroupInput(t *testing.T) {
468
471
TargetType : awssdk .String ("ip" ),
469
472
},
470
473
},
474
+ {
475
+ name : "standard case ipv6 address" ,
476
+ args : args {
477
+ tgSpec : elbv2model.TargetGroupSpec {
478
+ Name : "my-tg" ,
479
+ TargetType : elbv2model .TargetTypeIP ,
480
+ Port : 8080 ,
481
+ Protocol : elbv2model .ProtocolHTTP ,
482
+ IPAddressType : & ipAddressTypeIPv6 ,
483
+ HealthCheckConfig : & elbv2model.TargetGroupHealthCheckConfig {
484
+ Port : & port9090 ,
485
+ Protocol : & protocolHTTP ,
486
+ Path : awssdk .String ("/healthcheck" ),
487
+ Matcher : & elbv2model.HealthCheckMatcher {HTTPCode : awssdk .String ("200" )},
488
+ IntervalSeconds : awssdk .Int64 (10 ),
489
+ TimeoutSeconds : awssdk .Int64 (5 ),
490
+ HealthyThresholdCount : awssdk .Int64 (3 ),
491
+ UnhealthyThresholdCount : awssdk .Int64 (2 ),
492
+ },
493
+ },
494
+ },
495
+ want : & elbv2sdk.CreateTargetGroupInput {
496
+ HealthCheckEnabled : awssdk .Bool (true ),
497
+ HealthCheckIntervalSeconds : awssdk .Int64 (10 ),
498
+ HealthCheckPath : awssdk .String ("/healthcheck" ),
499
+ HealthCheckPort : awssdk .String ("9090" ),
500
+ HealthCheckProtocol : awssdk .String ("HTTP" ),
501
+ HealthCheckTimeoutSeconds : awssdk .Int64 (5 ),
502
+ HealthyThresholdCount : awssdk .Int64 (3 ),
503
+ Matcher : & elbv2sdk.Matcher {HttpCode : awssdk .String ("200" )},
504
+ UnhealthyThresholdCount : awssdk .Int64 (2 ),
505
+ Name : awssdk .String ("my-tg" ),
506
+ Port : awssdk .Int64 (8080 ),
507
+ Protocol : awssdk .String ("HTTP" ),
508
+ TargetType : awssdk .String ("ip" ),
509
+ IpAddressType : awssdk .String ("ipv6" ),
510
+ },
511
+ },
471
512
}
472
513
for _ , tt := range tests {
473
514
t .Run (tt .name , func (t * testing.T ) {
0 commit comments