HTTP API, ALB integration 5XX errors

0

Hi, I have below setup as I followed following tutorial : https://aws.amazon.com/blogs/compute/configuring-private-integrations-with-amazon-api-gateway-http-apis/

customdomain (my.domain.com) -> HTTPAPI -> VPC Link -> ALB -> ECS

VPCLink:

  • VPC for ALB is used
  • Subnets for ALB are added
  • Security groups for ALB is added

Integration:

  • ALB is selected
  • 443 HTTPS Listener is selected
  • VPC Link is selected

Paramater Mapping for Integration:

  • path -> overwrite -> $request.path

Routing: "ANY /{proxy}" route is added and integration is attached.

Deployment:

  • "prod" stage is created, auto-deploy is enabled

Route53: Domain (my.domain.com) is added as an A record pointing to custom domain

When I make request using my.domain.com (same if I use auto generated stage url) I always get 503 errors. I checked and ECS instance is running properly and healthy.

Sample access log : { "requestId": "Z6KDRhh0DoEEJhg=", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", "sourceIp": "my_ip", "requestTime": "12/Oct/2022:20:29:34 +0000", "requestTimeEpoch": "1665606574", "httpMethod": "GET", "path": "/", "status": "503", "protocol": "HTTP/1.1", "responseLength": "33", "domainName": "my.domain.com", "integrationError": "-", "integrationDotError": "-", "integrationStatus": "200", "integrationDotStatus": "-", "integrationDotIntegrationStatus": "200", "integrationLatency": "9001" }

What am I missing? Please help.

2개 답변
1
수락된 답변

I found the root cause of the 503 errors. VPC links require to use private subnets. If I put public subnets along with the private subnets it returns 503 errors most of the time. After removing public subnets from the VPC Link it is fixed.

답변함 2년 전
profile picture
전문가
검토됨 25일 전
0

Hello,

I believe the above logs is from applicaiton load balancer access logs.

Check your Application Load Balancer access logs. Confirm that there is an elb_status_code = 503 in the logs. If you see 503 errors in any of these places, the error is generated by your Application Load Balancer.

  1. Please verify the hat the target group has registered targets
  2. Check that the traffic port and the health check port are the same.
  3. Also check all the services are running in the container
  4. It can also happen if you have the correct port configured in the health check settings, but the wrong port configured for sending actual traffic to the container.
AWS
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인