ALB Targets Turn Unhealthy With Target.Timeout After a Security Group Change on the Instances
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.
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.
-
AWS CLI access with Elastic Load Balancing and EC2 describe permissions.
-
Approval and permission to change the instance security group.
-
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.
-
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.
-
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.
-
Run aws ec2 revoke-security-group-ingress --group-id <instance group> --security-group-rule-ids <each recorded sgr- ID>.
-
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.
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
Health checks for Application Load Balancer target groups
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Troubleshoot your Application Load Balancers
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Security groups for your Application Load Balancer
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Security group rules
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
describe-target-health (AWS CLI Command Reference)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
describe-target-groups (AWS CLI Command Reference)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
describe-load-balancers (AWS CLI Command Reference)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
describe-instances (AWS CLI Command Reference)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
describe-security-group-rules (AWS CLI Command Reference)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
authorize-security-group-ingress (AWS CLI Command Reference)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
revoke-security-group-ingress (AWS CLI Command Reference)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
lookup-events (AWS CLI Command Reference)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Recommended reading
More from KBY that goes with this runbook.
Related runbooks
GitLab CI Services From Amazon ECR Fail to Pull After 12 Hours: Switch to the ECR Credential Helper
GitLab CI jobs whose image or services come from a private Amazon ECR registry fail with no basic auth credentials or HTTP 403 when DOCKER_AUTH_CONFIG holds a pasted ECR token, which lasts 12 hours. Refresh it to unblock, then install docker-credential-ecr-login on a self-managed runner with a pull-only IAM role and use credHelpers.
AWS DRS Replication Agent Crash or Agent Not Seen
Diagnose an AWS Elastic Disaster Recovery replication agent crash or AGENT_NOT_SEEN state by checking the source service, agent logs, regional endpoint access and TCP 1500 path before any restart or reinstall that could trigger a rescan and affect RPO.
AWS Step Functions Execution Timeout: Diagnose States.Timeout
Diagnose an AWS Step Functions States.Timeout by separating workflow, task, heartbeat, HTTP Task and downstream-service limits. Change retry, catch or timeout policy only once you understand the execution type and any duplicate side effects.
