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 réponses
2
Réponse acceptée

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.

répondu il y a 2 ans
profile picture
EXPERT
vérifié il y a 20 heures
profile picture
EXPERT
vérifié il y a 2 mois
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
répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions