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 個答案
2
已接受的答案

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
專家
已審閱 15 小時前
profile picture
專家
已審閱 2 個月前
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南