Update health settings for your Application Load Balancer target group - Elastic Load Balancing
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Update health settings for your Application Load Balancer target group

By default, Application Load Balancers monitor the health of targets and route requests to healthy targets. However, if the load balancer doesn't have enough healthy targets, it automatically sends traffic to all registered targets (fail open). You can modify the target group health settings for your target group to define the thresholds for DNS failover and routing failover. For more information, see Target group health.

Console
To modify target group health settings
  1. Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/.

  2. In the navigation pane, under Load Balancing, choose Target Groups.

  3. Choose the name of the target group to open its details page.

  4. On the Attributes tab, choose Edit.

  5. Check whether cross-zone load balancing is turned on or turned off. Update this setting as needed to ensure that you have enough capacity to handle the additional traffic if a zone fails.

  6. Expand Target group health requirements.

  7. For Configuration type, we recommend that you choose Unified configuration, which sets the same threshold for both actions.

  8. For Healthy state requirements, do one of the following:

    • Choose Minimum healthy target count, and then enter a number from 1 to the maximum number of targets for your target group.

    • Choose Minimum healthy target percentage, and then enter a number from 1 to 100.

  9. Choose Save changes.

Amazon CLI
To modify target group health settings

Use the modify-target-group-attributes command. The following example sets the healthy threshold for both unhealthy state actions to 50%.

aws elbv2 modify-target-group-attributes \ --target-group-arn target-group-arn \ --attributes \ "Key=target_group_health.dns_failover.minimum_healthy_targets.percentage,Value=50" \ "Key=target_group_health.unhealthy_state_routing.minimum_healthy_targets.percentage,Value=50"
CloudFormation
To modify target group health settings

Update the AWS::ElasticLoadBalancingV2::TargetGroup resource. The following example sets the healthy threshold for both unhealthy state actions to 50%.

Resources: myTargetGroup: Type: 'AWS::ElasticLoadBalancingV2::TargetGroup' Properties: Name: my-target-group Protocol: HTTP Port: 80 TargetType: ip VpcId: !Ref myVPC TargetGroupAttributes: - Key: "target_group_health.dns_failover.minimum_healthy_targets.percentage" Value: "50" - Key: "target_group_health.unhealthy_state_routing.minimum_healthy_targets.percentage" Value: "50"