Skip to content

CICD-334 · Load balancer health verification ​

Encyclopedia · Advanced networking and API testing · All snippets

Previous · CICD-333 · Next · CICD-335

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites authorized test service, known endpoint or local fixture and the named test CLI.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters TARGET_GROUP_ARN.

2. Copy the snippet ​

bash
aws elbv2 describe-target-health --target-group-arn "${TARGET_GROUP_ARN:?}" --query 'TargetHealthDescriptions[].TargetHealth.State' --output json | jq -e 'length > 0 and all(. == "healthy")'

3. How it works ​

The command archives or inspects the selected files. Verify the relative paths and file set before using the archive downstream. The expression filters or transforms the input JSON. Where jq -e is used, a false or empty result can fail the gate.

4. Verify the result ​

A healthy target set must also meet minimum desired capacity if your service can run degraded.

Validation syntax-validated (Bash parse). Status definitions.