1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| $aws elbv2 describe-target-groups | jq -r '.TargetGroups[] | select (.TargetGroupName == "tutorial-alb-ec2-tg")' { "TargetGroupArn": "arn:aws:elasticloadbalancing:ap-northeast-1:XXXXXXXXXXX:targetgroup/tutorial-alb-ec2-tg/XXXXXXXXXXXXXX", "TargetGroupName": "tutorial-alb-ec2-tg", "Protocol": "HTTP", "Port": 80, "VpcId": "vpc-XXXXXXXXXXXXXXXXXXX", "HealthCheckProtocol": "HTTP", "HealthCheckPort": "traffic-port", "HealthCheckEnabled": true, "HealthCheckIntervalSeconds": 10, "HealthCheckTimeoutSeconds": 5, "HealthyThresholdCount": 2, "UnhealthyThresholdCount": 2, "HealthCheckPath": "/", "Matcher": { "HttpCode": "200" }, "LoadBalancerArns": [ "arn:aws:elasticloadbalancing:ap-northeast-1:XXXXXXXXXXX:loadbalancer/app/tutorial-alb-ec2-alb/XXXXXXXXXXXXXXXXXXX" ], "TargetType": "instance" }
$aws elbv2 describe-target-groups | jq -r '.TargetGroups[] | select (.TargetGroupName == "tutorial-alb-ec2-tg") | .TargetGroupArn' arn:aws:elasticloadbalancing:ap-northeast-1:XXXXXXXXXXX:targetgroup/tutorial-alb-ec2-tg/XXXXXXXXXXXXXX
$aws elbv2 describe-target-health --target-group-arn arn:aws:elasticloadbalancing:ap-northeast-1:XXXXXXXXXXX:targetgroup/tutorial-alb-ec2-tg/XXXXXXXXXXXXXX { "TargetHealthDescriptions": [ { "Target": { "Id": "i-XXXXXXXXXXXXXXXXXXX", "Port": 80 }, "HealthCheckPort": "80", "TargetHealth": { "State": "unhealthy", "Reason": "Target.ResponseCodeMismatch", "Description": "Health checks failed with these codes: [502]" } }, { "Target": { "Id": "i-XXXXXXXXXXXXXXXXXXX", "Port": 80 }, "HealthCheckPort": "80", "TargetHealth": { "State": "unhealthy", "Reason": "Target.ResponseCodeMismatch", "Description": "Health checks failed with these codes: [502]" } } ] }
$aws elbv2 describe-target-health --target-group-arn arn:aws:elasticloadbalancing:ap-northeast-1:XXXXXXXXXXX:targetgroup/tutorial-alb-ec2-tg/XXXXXXXXXXXXXX { "TargetHealthDescriptions": [ { "Target": { "Id": "i-XXXXXXXXXXXXXXXXXXX", "Port": 80 }, "HealthCheckPort": "80", "TargetHealth": { "State": "healthy" } }, { "Target": { "Id": "i-XXXXXXXXXXXXXXXXXXX", "Port": 80 }, "HealthCheckPort": "80", "TargetHealth": { "State": "healthy" } } ] }
|