Use ConfigureHealthCheck with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use ConfigureHealthCheck with a CLI

The following code examples show how to use ConfigureHealthCheck.

CLI
AWS CLI

To specify the health check settings for your backend EC2 instances

This example specifies the health check settings used to evaluate the health of your backend EC2 instances.

Command:

aws elb configure-health-check --load-balancer-name my-load-balancer --health-check Target=HTTP:80/png,Interval=30,UnhealthyThreshold=2,HealthyThreshold=2,Timeout=3

Output:

{ "HealthCheck": { "HealthyThreshold": 2, "Interval": 30, "Target": "HTTP:80/png", "Timeout": 3, "UnhealthyThreshold": 2 } }
PowerShell
Tools for PowerShell

Example 1: This example configures the health check settings for the specified load balancer.

Set-ELBHealthCheck -LoadBalancerName my-load-balancer ` >> -HealthCheck_HealthyThreshold 2 ` >> -HealthCheck_UnhealthyThreshold 2 ` >> -HealthCheck_Target "HTTP:80/ping" ` >> -HealthCheck_Interval 30 ` >> -HealthCheck_Timeout 3

Output:

HealthyThreshold : 2 Interval : 30 Target : HTTP:80/ping Timeout : 3 UnhealthyThreshold : 2