Skip to content

Commit

Permalink
Make a couple more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mert Acikportali committed Apr 24, 2024
1 parent adc2cbc commit 661b74b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
18 changes: 10 additions & 8 deletions internal/service/elbv2/target_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,10 @@ func ResourceTargetGroup() *schema.Resource {
Default: "off",
},
"minimum_healthy_targets_percentage": {
Type: schema.TypeString,
Optional: true,
Default: "off",
Type: schema.TypeString,
Optional: true,
Default: "off",
ValidateFunc: validation.IntBetween(1, 100),
},
},
},
Expand All @@ -364,9 +365,10 @@ func ResourceTargetGroup() *schema.Resource {
Default: 1,
},
"minimum_healthy_targets_percentage": {
Type: schema.TypeString,
Optional: true,
Default: "off",
Type: schema.TypeString,
Optional: true,
Default: "off",
ValidateFunc: validation.IntBetween(1, 100),
},
},
},
Expand Down Expand Up @@ -1369,8 +1371,8 @@ func expandTargetGroupHealthAttributes(tfMap map[string]interface{}) []*elbv2.Ta
if unhealthyStateRoutingMap, ok := targetGroupHealthMap["unhealthy_state_routing"].(map[string]interface{}); ok {
apiObjects = append(apiObjects,
&elbv2.TargetGroupAttribute{
Key: aws.Int64("unhealthy_state_routing.minimum_healthy_targets_count"),
Value: aws.String(unhealthyStateRoutingMap["minimum_healthy_targets_count"].(string)),
Key: aws.String("unhealthy_state_routing.minimum_healthy_targets_count"),
Value: flex.IntValueToString(unhealthyStateRoutingMap["minimum_healthy_targets_count"].(int)),
},
&elbv2.TargetGroupAttribute{
Key: aws.String("unhealthy_state_routing.minimum_healthy_targets_percentage"),
Expand Down
8 changes: 4 additions & 4 deletions internal/service/elbv2/target_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5111,13 +5111,13 @@ resource "aws_lb_target_group" "test" {
target_group_health {
dns_failover {
minimum_healthy_targets_count = %[2]s
minimum_healthy_targets_percentage = %[3]s
minimum_healthy_targets_count = %[2]q
minimum_healthy_targets_percentage = %[3]q
}
unhealthy_state_routing {
minimum_healthy_targets_count = %[4]d
minimum_healthy_targets_percentage = %[5]s
minimum_healthy_targets_count = %[4]q
minimum_healthy_targets_percentage = %[5]q
}
}
}
Expand Down

0 comments on commit 661b74b

Please sign in to comment.