Skip to main content

ALB Targets Turn Unhealthy With Target.Timeout After a Security Group Change on the Instances

High severity Target recovery 30mAmazon Web Services

Overview

Application Load Balancer targets that turn unhealthy with Target.Timeout after an instance security group change are blocking the health checks. Confirm with describe-target-health and the security group rules, then add one inbound rule whose source is the load balancer security group on the traffic and health check ports, keeping its rule ID for rollback and never opening the instances wider.

Markdown, one checkbox per step, for pasting into a ticket.

Diagnose

Symptom

What responders observe.

Use it when all of these hold: describe-target-health shows targets unhealthy with Target.Timeout ("Request timed out"). Clients get HTTP 504 from the load balancer.

AWS lists a failed connection to the target within the 10-second connection timeout as one cause. A change to the instances' security group, or to which groups the instances use, happened shortly before, such as hardening work that removed a broad rule.

If the reason is Target.ResponseCodeMismatch or Target.NotRegistered, this is not your runbook: the fault is the application's response or the registration, not the network path.

Detection

Metrics, logs and confirmation commands.

Root cause

Why the incident occurred.

Contain and prevent

Blast radius

What else this can affect.

Prevention

Controls and guardrails that stop it recurring.

  • Write the load balancer rule into the hardening standard, so the next review keeps a source-group rule instead of deleting it with the broad ones.

  • Whenever a listener is added or a health check port changes, check both security groups allow the new port in both directions, as AWS asks.

  • Alarm on the target group's unhealthy host count, so a rule change shows up in minutes rather than through users.

  • Review permission changes against what the workload still needs.

  • A scope that is too tight fails just as abruptly, as the Lambda log group trap with a narrowly scoped execution role shows.

  • The Step Functions States.Timeout runbook uses the same read-first approach for AWS failures that surface as timeouts.

Fix

Pre-flight checks

Check these before you change anything.

  1. AWS CLI access with Elastic Load Balancing and EC2 describe permissions.

  2. Approval and permission to change the instance security group.

  3. The target group ARN and one target instance ID.

Commands

aws elbv2 describe-target-health --target-group-arn "$TG_ARN" --query 'TargetHealthDescriptions[].[Target.Id,Target.Port,TargetHealth.State,TargetHealth.Reason]' --output table
aws elbv2 describe-target-groups --target-group-arns "$TG_ARN" --query 'TargetGroups[0].[Port,HealthCheckProtocol,HealthCheckPort,HealthCheckPath]'
aws elbv2 describe-load-balancers --names web-alb --query 'LoadBalancers[0].SecurityGroups'
aws ec2 describe-instances --instance-ids i-0123456789abcdef0 --query 'Reservations[].Instances[].SecurityGroups'
aws ec2 describe-security-group-rules --filters Name=group-id,Values=sg-0inst1111aaaa2222
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=RevokeSecurityGroupIngress --start-time 2026-11-24T00:00:00Z
aws ec2 authorize-security-group-ingress --group-id sg-0inst1111aaaa2222 --protocol tcp --port 8080 --source-group sg-0alb33333bbbb4444 --dry-run
aws ec2 authorize-security-group-ingress --group-id sg-0inst1111aaaa2222 --protocol tcp --port 8080 --source-group sg-0alb33333bbbb4444
aws ec2 revoke-security-group-ingress --group-id sg-0inst1111aaaa2222 --security-group-rule-ids sgr-0123456789abcdef0

Verify and recover

Verification

Evidence required before you close the incident.

  1. Run describe-target-health after about three minutes. — Every target healthy with no reason code. — No target reports Target.Timeout. Request the site through the load balancer. — Normal responses. — No HTTP 504 from the load balancer.

  2. Run describe-security-group-rules on the instance group. — Only the recorded new inbound rules differ from the saved JSON. — No wider rule was added.

Rollback

The safe way back.

  1. Run aws ec2 revoke-security-group-ingress --group-id <instance group> --security-group-rule-ids <each recorded sgr- ID>.

  2. Compare describe-security-group-rules output with the JSON saved before the change.

Escalate when

Conditions that need another owner.

  • To the network owner when the rules are correct but targets still time out.

  • AWS also lists subnet network ACLs: the instances' subnets must allow inbound on the health check port and outbound on ephemeral ports 1024 to 65535.

  • To the application owner when the security groups and ACLs are right but nothing is listening on the health check port.

  • To the load balancer owner when its security group lacks the outbound rule to the instances.

  • Network owner or application owner Security group owner Load balancer owner.

The KBY Brief

Fixed? Get the next one before it hits you: The KBY Brief

Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.

About this page

Credited to

Dates

Published

Corrections

No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.

Sources

Based on the vendor sources listed below. Check each step against your environment before acting.

First published 24 November 2026

Publisher: Amazon Web Servicesdocs.aws.amazon.com

Health checks for Application Load Balancer target groups

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Amazon Web Servicesdocs.aws.amazon.com

Troubleshoot your Application Load Balancers

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Amazon Web Servicesdocs.aws.amazon.com

Security groups for your Application Load Balancer

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Amazon Web Servicesdocs.aws.amazon.com

Security group rules

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Amazon Web Servicesdocs.aws.amazon.com

describe-target-health (AWS CLI Command Reference)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Amazon Web Servicesdocs.aws.amazon.com

describe-target-groups (AWS CLI Command Reference)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Amazon Web Servicesdocs.aws.amazon.com

describe-load-balancers (AWS CLI Command Reference)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Amazon Web Servicesdocs.aws.amazon.com

describe-instances (AWS CLI Command Reference)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Amazon Web Servicesdocs.aws.amazon.com

describe-security-group-rules (AWS CLI Command Reference)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Amazon Web Servicesdocs.aws.amazon.com

authorize-security-group-ingress (AWS CLI Command Reference)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Amazon Web Servicesdocs.aws.amazon.com

revoke-security-group-ingress (AWS CLI Command Reference)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Amazon Web Servicesdocs.aws.amazon.com

lookup-events (AWS CLI Command Reference)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

More from KBY that goes with this runbook.